Workflow: ezcWorkflowNodeSynchronizingMerge
[ ]
[ ]
[ ]
[ ]
[ ]
Class: ezcWorkflowNodeSynchronizingMerge
|
This node implements the Synchronizing Merge workflow pattern. [
source]
The Synchronizing Merge workflow pattern is to be used to synchronize multiple parallel threads of execution that are activated by a preceding Multi-Choice.
Incoming nodes: 2..* Outgoing nodes: 1
This example displays how you can use ezcWorkflowNodeMultiChoice to activate one or more branches depending on the input and how you can use a synchronizing merge to merge them together again. Execution will not contiue until all activated branches have been completed.
1. $workflow = new ezcWorkflow( 'Test' );
2.
3. // wait for input into the workflow variable value.
4. $input = new ezcWorkflowNodeInput( array( 'value' => new ezcWorkflowConditionIsInt ) );
5. $workflow->startNode->addOutNode( $input );
6.
7. // create the exclusive choice branching node
8. $choice = new ezcWorkflowNodeMultiChoice;
9. $intput->addOutNode( $choice );
10.
11. $branch1 = ....; // create nodes for the first branch of execution here..
12. $branch2 = ....; // create nodes for the second branch of execution here..
13.
14. // add the outnodes and set the conditions on the exclusive choice
15. $choice->addConditionalOutNode( new ezcWorkflowConditionVariable( 'value',
16. new ezcWorkflowConditionGreaterThan( 1 ) ),
17. $branch1 );
18. $choice->addConditionalOutNode( new ezcWorkflowConditionVariable( 'value',
19. new ezcWorkflowConditionGreaterThan( 10 ) ),
20. $branch2 );
21.
22. // Merge the two branches together and continue execution.
23. $merge = new ezcWorkflowNodeSynchronizingMerge();
24. $merge->addInNode( $branch1 );
25. $merge->addInNode( $branch2 );
26. $merge->addOutNode( $workflow->endNode );
Parents
ezcWorkflowNode
|
--ezcWorkflowNodeMerge
|
--ezcWorkflowNodeSynchronization
|
--ezcWorkflowNodeSynchronizingMerge
Inherited Constants
From
ezcWorkflowNode:
Inherited Member Variables
From
ezcWorkflowNodeMerge:
From
ezcWorkflowNode:
Inherited Methods
From
ezcWorkflowNodeMerge :
From
ezcWorkflowNode :
Last updated: Mon, 17 Dec 2007