Ignore:
Timestamp:
03/29/10 14:46:01 (14 years ago)
Author:
pedroerp
Message:

Ticket #609 - Merged 2197:2356 /sandbox/workflow/branches/609/ em /sandbox/workflow/trunk.

Location:
sandbox/workflow/trunk/inc/engine/src/ProcessManager
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • sandbox/workflow/trunk/inc/engine/src/ProcessManager/ActivityManager.php

    r795 r2372  
    2626   * @access public 
    2727   */ 
    28   function ActivityManager(&$db) 
    29   { 
    30     parent::BaseManager($db); 
     28  function ActivityManager() 
     29  { 
     30    parent::BaseManager(); 
    3131    $this->child_name = 'ActivityManager'; 
    3232    require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'ProcessManager' .SEP . 'ProcessManager.php'); 
     
    370370  function build_process_graph($pId) 
    371371  { 
    372     if (!(isset($this->process_manager))) $this->process_manager = new ProcessManager($this->db); 
     372    if (!(isset($this->process_manager))) $this->process_manager = &Factory::newInstance('ProcessManager'); 
    373373    $attributes = Array( 
    374374     
    375375    ); 
    376     $graph = new Process_GraphViz(true,$attributes); 
     376    $graph = &Factory::newInstance('Process_GraphViz', true, $attributes); 
    377377    $name = $this->process_manager->_get_normalized_name($pId); 
    378378    $graph->set_pid($name); 
     
    747747  { 
    748748    require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'API'.SEP . 'BaseActivity.php'); 
    749     $act = new BaseActivity($this->db); 
     749    $act = &Factory::newInstance('BaseActivity'); 
    750750    //Warning, we now use the BaseActivity object for it, interactivity and autorouting is now true/fales, not y/n 
    751751    return ($act->getActivity($activityId,false,true, true)); 
     
    825825  function remove_activity($pId, $activityId, $transaction = true) 
    826826  { 
    827     if (!(isset($this->process_manager))) $this->process_manager = new ProcessManager($this->db); 
     827    if (!(isset($this->process_manager))) $this->process_manager = &Factory::newInstance('ProcessManager'); 
    828828    $proc_info = $this->process_manager->get_process($pId); 
    829829    $actname = $this->_get_normalized_name($activityId); 
     
    888888  function replace_activity($pId, $activityId, $vars, $create_files=true) 
    889889  { 
    890     if (!(isset($this->process_manager))) $this->process_manager = new ProcessManager($this->db); 
     890    if (!(isset($this->process_manager))) $this->process_manager = &Factory::newInstance('ProcessManager'); 
    891891    $TABLE_NAME = GALAXIA_TABLE_PREFIX.'activities'; 
    892892    $now = date("U"); 
     
    11951195    elseif ( (!($result=='*')) && $performAccessCheck) 
    11961196    { 
    1197       $wf_security = new WfSecurity($this->db); 
     1197      $wf_security = &Factory::getInstance('WfSecurity', $this->db); 
    11981198      // perform the check 
    11991199      if (!($wf_security->checkUserAccess($result,$activityId))) 
  • sandbox/workflow/trunk/inc/engine/src/ProcessManager/BaseManager.php

    r2165 r2372  
    1818   * @access public 
    1919   */ 
    20   function BaseManager(&$db) 
     20  function BaseManager() 
    2121  { 
    2222    $this->child_name = 'BaseManager'; 
    23     parent::Base($db); 
     23    parent::Base(); 
    2424  } 
    2525 
  • sandbox/workflow/trunk/inc/engine/src/ProcessManager/InstanceManager.php

    r795 r2372  
    1616   * @access public 
    1717   */ 
    18   function InstanceManager(&$db)  
    19   { 
    20     parent::BaseManager($db); 
     18  function InstanceManager()  
     19  { 
     20    parent::BaseManager(); 
    2121    $this->child_name = 'InstanceManager'; 
    2222  } 
  • sandbox/workflow/trunk/inc/engine/src/ProcessManager/JobManager.php

    r795 r2372  
    7676         * @access public 
    7777         */ 
    78         public function JobManager(&$db) 
    79         { 
    80                 parent::BaseManager($db); 
     78        public function JobManager() 
     79        { 
     80                parent::BaseManager(); 
    8181                $this->child_name = 'JobManager'; 
    8282 
    8383                $this->jobTable = GALAXIA_TABLE_PREFIX . 'jobs'; 
    8484                $this->logTable = GALAXIA_TABLE_PREFIX . 'job_logs'; 
    85                 $this->processManager = new ProcessManager($this->db); 
     85                $this->processManager = &Factory::newInstance('ProcessManager'); 
    8686        } 
    8787 
  • sandbox/workflow/trunk/inc/engine/src/ProcessManager/ProcessManager.php

    r2165 r2372  
    6666         * @access public 
    6767         */ 
    68         function ProcessManager(&$db) 
    69         { 
    70                 parent::BaseManager($db); 
     68        function ProcessManager() 
     69        { 
     70                parent::BaseManager(); 
    7171                $this->child_name = 'ProcessManager'; 
    72                 require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'ProcessManager'.SEP.'ActivityManager.php'); 
    73                 require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'ProcessManager'.SEP.'JobManager.php'); 
    7472                // $this->activity_manager is not set here to avoid objects loading object A loading object B loading object A, etc 
    7573                //$this->role_manager will only be loaded when needed as well 
     
    131129        function serialize_process($pId) 
    132130        { 
    133                 if (!(isset($this->activity_manager)))  $this->activity_manager = new ActivityManager($this->db); 
     131                if (!(isset($this->activity_manager)))  $this->activity_manager = &Factory::newInstance('ActivityManager'); 
    134132                // <process> 
    135133                $out = '<process>'."\n"; 
     
    459457        { 
    460458                //Now the show begins 
    461                 if (!(isset($this->activity_manager)))  $this->activity_manager = new ActivityManager($this->db); 
    462                 if (!(isset($this->role_manager))) $this->role_manager = new RoleManager($this->db); 
     459                if (!(isset($this->activity_manager)))  $this->activity_manager = &Factory::newInstance('ActivityManager'); 
     460                if (!(isset($this->role_manager))) $this->role_manager = &Factory::newInstance('RoleManager'); 
    463461                if (!isset($this->jobManager)) 
    464                         $this->jobManager = new JobManager($this->db); 
     462                        $this->jobManager = &Factory::newInstance('JobManager'); 
    465463 
    466464                // First create the process. Always inactive and inactive first. 
     
    620618        function new_process_version($pId, $minor=true) 
    621619        { 
    622                 if (!(isset($this->activity_manager)))  $this->activity_manager = new ActivityManager($this->db); 
     620                if (!(isset($this->activity_manager)))  $this->activity_manager = &Factory::newInstance('ActivityManager'); 
    623621                $oldpid = $pId; 
    624622                //retrieve process info with config rows 
     
    671669                } 
    672670                // create roles 
    673                 if (!(isset($this->role_manager))) $this->role_manager = new RoleManager($this->db); 
     671                if (!(isset($this->role_manager))) $this->role_manager = &Factory::newInstance('RoleManager'); 
    674672                $query = 'select * from '.GALAXIA_TABLE_PREFIX.'roles where wf_p_id=?'; 
    675673                $result = $this->query($query, array($oldpid)); 
     
    853851        function remove_process($pId) 
    854852        { 
    855                 if (!(isset($this->activity_manager)))  $this->activity_manager = new ActivityManager($this->db); 
     853                if (!(isset($this->activity_manager)))  $this->activity_manager = &Factory::newInstance('ActivityManager'); 
    856854                if (!isset($this->jobManager)) 
    857                         $this->jobManager = new JobManager($this->db); 
     855                        $this->jobManager = &Factory::newInstance('JobManager'); 
    858856                $this->deactivate_process($pId); 
    859857                $name = $this->_get_normalized_name($pId); 
     
    919917        function replace_process($pId, &$vars, $create = true) 
    920918        { 
    921                 if (!(isset($this->activity_manager)))  $this->activity_manager = new ActivityManager($this->db); 
     919                if (!(isset($this->activity_manager)))  $this->activity_manager = &Factory::newInstance('ActivityManager'); 
    922920                $TABLE_NAME = GALAXIA_TABLE_PREFIX.'processes'; 
    923921                $now = date("U"); 
     
    12961294                { 
    12971295                        //Warning: this means you have to include the Process.php from the API 
    1298                         $this->Process = new Process($this->db); 
     1296                        $this->Process = &Factory::newInstance('Process'); 
    12991297                        $this->Process->getProcess($pId); 
    13001298                        $result_array = $this->Process->getConfigValues($config_array); 
     
    13161314        { 
    13171315                //Warning: this means you have to include the Process.php from the API 
    1318                 $this->Process = new Process($this->db); 
     1316                $this->Process = &Factory::newInstance('Process'); 
    13191317                $this->Process->getProcess($pId); 
    13201318                $this->Process->setConfigValues($config_array); 
  • sandbox/workflow/trunk/inc/engine/src/ProcessManager/RoleManager.php

    r795 r2372  
    1919   * @access public 
    2020   */ 
    21   function RoleManager(&$db)  
    22   { 
    23     parent::Base($db); 
     21  function RoleManager()  
     22  { 
     23    parent::Base(); 
    2424    $this->child_name = 'RoleManager'; 
    2525  } 
     
    247247    $result = $this->query($query,$bindvars); 
    248248    $ret = Array(); 
    249     $ldap = &$GLOBALS['workflow']['factory']->getInstance('WorkflowLDAP'); 
     249    $ldap = &Factory::getInstance('WorkflowLDAP'); 
    250250    if (!(empty($result))) 
    251251    { 
     
    256256          //we have a group instead of a simple user and we want real users 
    257257          $real_users = galaxia_retrieve_group_users($res['wf_user'], true); 
    258           foreach ($real_users as $key => $value) 
    259           { 
    260             $ret[$key]=$value; 
    261           } 
     258                  if (!empty($real_users)) { 
     259            foreach ($real_users as $key => $value) 
     260            { 
     261              $ret[$key]=$value; 
     262            } 
     263                  } 
    262264        } 
    263265        else 
Note: See TracChangeset for help on using the changeset viewer.