Changeset 1293 for sandbox/workflow/2.0/inc/class.ui_agent.inc.php
- Timestamp:
- 08/07/09 16:06:07 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/workflow/2.0/inc/class.ui_agent.inc.php
r795 r1293 11 11 12 12 /** 13 * Agents abstraction library. interface layer. 13 * Agents abstraction library. interface layer. 14 14 * This allows the Workflow Engine to connect to various agents 15 15 * Agents are external elements for the workflow. It could be … … 17 17 * Use this class to make childrens like, for example in the 18 18 * class.ui_agent_mail_smtp.inc.php for the mail_smtp susbsytem 19 * 19 * 20 20 * @package Workflow 21 21 * @license http://www.gnu.org/copyleft/gpl.html GPL … … 23 23 */ 24 24 require_once(dirname(__FILE__) . SEP . 'class.WorkflowUtils.inc.php'); 25 25 26 26 class ui_agent extends WorkflowUtils 27 27 { … … 39 39 * @var bool $interactivity for runtime mode 40 40 * @access public 41 */ 41 */ 42 42 var $interactivity = false; 43 43 44 44 // concerning Child classes constructors --------------------------------------------- 45 45 /** 46 46 * @var object bo_agent object which have to be set in your child class to the right bo_agent child 47 * @access public 47 * @access public 48 48 */ 49 49 var $bo_agent = null; … … 54 54 var $agent_type = ''; 55 55 // ----------------------------------------------------------------------------------- 56 56 57 57 /** 58 58 * Constructor … … 64 64 parent::WorkflowUtils(); 65 65 } 66 66 67 67 /** 68 68 * Function which must be called (internally) at runtime .The agent MUST know if he is runned in an interactive activity or not. … … 79 79 * Return errors recorded by this object 80 80 * You should always call this function after failed operations on a workflow object to obtain messages 81 * @param array $as_array if true the result will be send as an array of errors or an empty array. Else, if you do not give any parameter 81 * @param array $as_array if true the result will be send as an array of errors or an empty array. Else, if you do not give any parameter 82 82 * or give a false parameter you will obtain a single string which can be empty or will contain error messages with <br /> html tags. 83 83 * @access public 84 * @return array errors 85 */ 86 function get_error($as_array=false) 84 * @return array errors 85 */ 86 function get_error($as_array=false) 87 87 { 88 88 $this->error[] = $this->bo_agent->get_error(); … … 95 95 return $result_str; 96 96 } 97 97 98 98 /** 99 99 * Factory: load the agent values stored somewhere via the agent bo object … … 106 106 return ( (isset($this->bo_agent)) && ($this->bo_agent->load($agent_id))); 107 107 } 108 108 109 109 /** 110 110 * Save the agent values somewhere via the agent bo object … … 116 116 { 117 117 if (!(isset($this->bo_agent))) 118 { 118 { 119 119 return false; 120 120 } … … 131 131 * we store references to theses objects and we tell the ui object if we are in interactive 132 132 * mode or not. 133 * @param array $instance 133 * @param array $instance 134 134 * @param object $activity activity 135 135 * @return void … … 141 141 $this->setInteractivity($activity->isInteractive()); 142 142 } 143 143 144 144 /** 145 145 * This function show the shared part of all agents when showing configuration in the admin activity form … … 147 147 * @param string $template_block_name 148 148 * @return void 149 * @access public 149 * @access public 150 150 */ 151 151 function showAdminActivityOptions ($template_block_name) 152 { 152 { 153 153 $admin_name = 'admin_agent_shared'; 154 154 $this->t->set_file($admin_name, $admin_name . '.tpl'); … … 161 161 $this->t->parse($template_block_name, $admin_name); 162 162 } 163 163 164 164 /** 165 165 * Function called by the running object (run_activity) after the activity_pre code … … 177 177 return true; 178 178 } 179 179 180 180 /** 181 181 * Function called by the running object (run_activity) after the activity_pre code … … 190 190 return true; 191 191 } 192 192 193 193 /** 194 194 * Function called by the running object (run_activity) after the user code 195 * 195 * 196 196 * and after the activity_pos code. This code is runned only if the $GLOBALS['__activity_completed'] 197 197 * IS NOT set (i.e.: the user is not yet completing the activity) … … 200 200 * user code after completion. 201 201 * @return bool true or false, if false the $this->error array should contains error messages 202 * @access public 202 * @access public 203 203 */ 204 204 function run_activity_completed_pos() … … 206 206 return true; 207 207 } 208 208 209 209 /** 210 210 * Function called by the running object (run_activity) after the user code 211 * 211 * 212 212 * and after the activity_pos code. This code is runned only if the $GLOBALS['__activity_completed'] 213 213 * IS set (i.e.: the user has completing the activity) … … 222 222 return true; 223 223 } 224 224 225 225 /** 226 226 * Retrieve infos set by the user in interactive forms ans store it with the bo_agent object
Note: See TracChangeset
for help on using the changeset viewer.