Ignore:
Timestamp:
08/07/09 16:06:07 (15 years ago)
Author:
gbisotto
Message:

Ticket #609 - Modificada a classe Factory e ProcessFactory? para automatizaro acesso ao objetos

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sandbox/workflow/2.0/inc/class.ui_agent.inc.php

    r795 r1293  
    1111 
    1212/** 
    13  * Agents abstraction library. interface layer.  
     13 * Agents abstraction library. interface layer. 
    1414 * This allows the Workflow Engine to connect to various agents 
    1515 * Agents are external elements for the workflow. It could be 
     
    1717 * Use this class to make childrens like, for example in the 
    1818 * class.ui_agent_mail_smtp.inc.php for the mail_smtp susbsytem 
    19  *  
     19 * 
    2020 * @package Workflow 
    2121 * @license http://www.gnu.org/copyleft/gpl.html GPL 
     
    2323 */ 
    2424require_once(dirname(__FILE__) . SEP . 'class.WorkflowUtils.inc.php'); 
    25          
     25 
    2626class ui_agent extends WorkflowUtils 
    2727{ 
     
    3939         * @var bool $interactivity for runtime mode 
    4040         * @access public 
    41          */  
     41         */ 
    4242        var $interactivity = false; 
    43          
     43 
    4444        // concerning Child classes constructors --------------------------------------------- 
    4545        /** 
    4646         * @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 
    4848         */ 
    4949        var $bo_agent = null; 
     
    5454        var $agent_type = ''; 
    5555        // ----------------------------------------------------------------------------------- 
    56          
     56 
    5757        /** 
    5858         * Constructor 
     
    6464                parent::WorkflowUtils(); 
    6565        } 
    66          
     66 
    6767        /** 
    6868         * Function which must be called (internally) at runtime .The agent MUST know if he is runned in an interactive activity or not. 
     
    7979         * Return errors recorded by this object 
    8080         * 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 
    8282         * or give a false parameter you will obtain a single string which can be empty or will contain error messages with <br /> html tags. 
    8383         * @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) 
    8787         { 
    8888                $this->error[] = $this->bo_agent->get_error(); 
     
    9595                return $result_str; 
    9696                } 
    97                          
     97 
    9898        /** 
    9999         * Factory: load the agent values stored somewhere via the agent bo object 
     
    106106                return ( (isset($this->bo_agent)) && ($this->bo_agent->load($agent_id))); 
    107107        } 
    108          
     108 
    109109        /** 
    110110         * Save the agent values somewhere via the agent bo object 
     
    116116        { 
    117117                if (!(isset($this->bo_agent))) 
    118                 {  
     118                { 
    119119                        return false; 
    120120                } 
     
    131131         * we store references to theses objects and we tell the ui object if we are in interactive 
    132132         * mode or not. 
    133          * @param array    $instance  
     133         * @param array    $instance 
    134134         * @param object   $activity activity 
    135135         * @return void 
     
    141141                $this->setInteractivity($activity->isInteractive()); 
    142142        } 
    143          
     143 
    144144        /** 
    145145         * This function show the shared part of all agents when showing configuration in the admin activity form 
     
    147147         * @param string $template_block_name 
    148148         * @return void 
    149          * @access public  
     149         * @access public 
    150150         */ 
    151151        function showAdminActivityOptions ($template_block_name) 
    152         {  
     152        { 
    153153                $admin_name = 'admin_agent_shared'; 
    154154                $this->t->set_file($admin_name, $admin_name . '.tpl'); 
     
    161161                $this->t->parse($template_block_name, $admin_name); 
    162162        } 
    163          
     163 
    164164        /** 
    165165         * Function called by the running object (run_activity) after the activity_pre code 
     
    177177                return true; 
    178178        } 
    179          
     179 
    180180        /** 
    181181         * Function called by the running object (run_activity) after the activity_pre code 
     
    190190                return true; 
    191191        } 
    192          
     192 
    193193        /** 
    194194         * Function called by the running object (run_activity) after the user code 
    195          *  
     195         * 
    196196         * and after the activity_pos code. This code is runned only if the $GLOBALS['__activity_completed'] 
    197197         * IS NOT set (i.e.: the user is not yet completing the activity) 
     
    200200         * user code after completion. 
    201201         * @return bool true or false, if false the $this->error array should contains error messages 
    202          * @access public  
     202         * @access public 
    203203         */ 
    204204        function run_activity_completed_pos() 
     
    206206                return true; 
    207207        } 
    208          
     208 
    209209   /** 
    210210        *  Function called by the running object (run_activity) after the user code 
    211         *  
     211        * 
    212212        *  and after the activity_pos code. This code is runned only if the $GLOBALS['__activity_completed'] 
    213213        *  IS set (i.e.: the user has completing the activity) 
     
    222222                return true; 
    223223        } 
    224          
     224 
    225225        /** 
    226226         * 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.