Revision 795,
1.1 KB
checked in by viani, 15 years ago
(diff) |
Ticket #488 - Inclusão do módulo workflow no ramo trunk do repositório Expresso.
|
-
Property svn:executable set to
*
|
Rev | Line | |
---|
[795] | 1 | <?php |
---|
| 2 | //Code to be executed before an activity by agents |
---|
| 3 | |
---|
| 4 | //retrieve agents list |
---|
| 5 | $activity_agents =& $this->activity->getAgents(); |
---|
| 6 | //for all agents we create ui_agent object to handle agents executing tasks |
---|
| 7 | foreach ($activity_agents as $agent) |
---|
| 8 | { |
---|
| 9 | //create an empty temp ui_agent object |
---|
| 10 | $ui_agent =& createObject('workflow.ui_agent_'.$agent['wf_agent_type']); |
---|
| 11 | //build this object |
---|
| 12 | $ui_agent->load($agent['wf_agent_id']); |
---|
| 13 | //At runtime agents need to handle relations with the instance and the activity |
---|
| 14 | $ui_agent->runtime($instance, $activity); |
---|
| 15 | //store it in an array |
---|
| 16 | $this->agents[$agent['wf_agent_type']] = $ui_agent; |
---|
| 17 | //delete the temp object |
---|
| 18 | unset($ui_agent); |
---|
| 19 | } |
---|
| 20 | |
---|
| 21 | if (!($GLOBALS['workflow']['__leave_activity'])) |
---|
| 22 | { |
---|
| 23 | foreach ($this->agents as $agent_type => $ui_agent) |
---|
| 24 | { |
---|
| 25 | if (!($ui_agent->run_activity_pre())) |
---|
| 26 | { |
---|
| 27 | galaxia_show_error($ui_agent->get_error(),false); |
---|
| 28 | } |
---|
| 29 | |
---|
| 30 | } |
---|
| 31 | } |
---|
| 32 | else |
---|
| 33 | { |
---|
| 34 | foreach ($this->agents as $agent_type => $ui_agent) |
---|
| 35 | { |
---|
| 36 | if (!($ui_agent->run_leaving_activity_pre())) |
---|
| 37 | { |
---|
| 38 | galaxia_show_error($ui_agent->get_error(), false); |
---|
| 39 | } |
---|
| 40 | } |
---|
| 41 | } |
---|
| 42 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.