Ignore:
Timestamp:
03/19/10 17:22:08 (14 years ago)
Author:
pedroerp
Message:

Ticket #609 - Migrando instanciação das classes da engine para a factory.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sandbox/workflow/branches/609/inc/engine/src/ProcessManager/ProcessManager.php

    r2165 r2311  
    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'; 
    7272                require_once(GALAXIA_LIBRARY.SEP.'src'.SEP.'ProcessManager'.SEP.'ActivityManager.php'); 
     
    131131        function serialize_process($pId) 
    132132        { 
    133                 if (!(isset($this->activity_manager)))  $this->activity_manager = new ActivityManager($this->db); 
     133                if (!(isset($this->activity_manager)))  $this->activity_manager = &Factory::newInstance('ActivityManager'); 
    134134                // <process> 
    135135                $out = '<process>'."\n"; 
     
    459459        { 
    460460                //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); 
     461                if (!(isset($this->activity_manager)))  $this->activity_manager = &Factory::newInstance('ActivityManager'); 
     462                if (!(isset($this->role_manager))) $this->role_manager = &Factory::newInstance('RoleManager'); 
    463463                if (!isset($this->jobManager)) 
    464                         $this->jobManager = new JobManager($this->db); 
     464                        $this->jobManager = &Factory::newInstance('JobManager'); 
    465465 
    466466                // First create the process. Always inactive and inactive first. 
     
    620620        function new_process_version($pId, $minor=true) 
    621621        { 
    622                 if (!(isset($this->activity_manager)))  $this->activity_manager = new ActivityManager($this->db); 
     622                if (!(isset($this->activity_manager)))  $this->activity_manager = &Factory::newInstance('ActivityManager'); 
    623623                $oldpid = $pId; 
    624624                //retrieve process info with config rows 
     
    671671                } 
    672672                // create roles 
    673                 if (!(isset($this->role_manager))) $this->role_manager = new RoleManager($this->db); 
     673                if (!(isset($this->role_manager))) $this->role_manager = &Factory::newInstance('RoleManager'); 
    674674                $query = 'select * from '.GALAXIA_TABLE_PREFIX.'roles where wf_p_id=?'; 
    675675                $result = $this->query($query, array($oldpid)); 
     
    853853        function remove_process($pId) 
    854854        { 
    855                 if (!(isset($this->activity_manager)))  $this->activity_manager = new ActivityManager($this->db); 
     855                if (!(isset($this->activity_manager)))  $this->activity_manager = &Factory::newInstance('ActivityManager'); 
    856856                if (!isset($this->jobManager)) 
    857                         $this->jobManager = new JobManager($this->db); 
     857                        $this->jobManager = &Factory::newInstance('JobManager'); 
    858858                $this->deactivate_process($pId); 
    859859                $name = $this->_get_normalized_name($pId); 
     
    919919        function replace_process($pId, &$vars, $create = true) 
    920920        { 
    921                 if (!(isset($this->activity_manager)))  $this->activity_manager = new ActivityManager($this->db); 
     921                if (!(isset($this->activity_manager)))  $this->activity_manager = &Factory::newInstance('ActivityManager'); 
    922922                $TABLE_NAME = GALAXIA_TABLE_PREFIX.'processes'; 
    923923                $now = date("U"); 
     
    12961296                { 
    12971297                        //Warning: this means you have to include the Process.php from the API 
    1298                         $this->Process = new Process($this->db); 
     1298                        $this->Process = &Factory::newInstance('Process'); 
    12991299                        $this->Process->getProcess($pId); 
    13001300                        $result_array = $this->Process->getConfigValues($config_array); 
     
    13161316        { 
    13171317                //Warning: this means you have to include the Process.php from the API 
    1318                 $this->Process = new Process($this->db); 
     1318                $this->Process = &Factory::newInstance('Process'); 
    13191319                $this->Process->getProcess($pId); 
    13201320                $this->Process->setConfigValues($config_array); 
Note: See TracChangeset for help on using the changeset viewer.