Workflow: ezcWorkflowNodeSimpleMerge
[ ]
[ ]
[ ]
[ ]
[ ]
Class: ezcWorkflowNodeSimpleMerge
|
This node implements the Simple Merge (XOR-Join) workflow pattern. [
source]
The Simple Merge workflow pattern is to be used to merge the possible paths that are defined by a preceding Exclusive Choice. It is assumed that of these possible paths exactly one is taken and no synchronization takes place.
Use Case Example: After the payment has been performed by either credit card or bank transfer, the order can be processed further.
Incoming nodes: 2..* Outgoing nodes: 1
This example displays how you can use a simple merge to tie together two different execution paths from an exclusive choice into one.
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 ezcWorkflowNodeExclusiveChoice;
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 ezcWorkflowConditionGreatherThan( 10 ) ),
17. $branch1 );
18. $choice->addConditionalOutNode( new ezcWorkflowConditionVariable( 'value',
19. new ezcWorkflowConditionLessThan( 11 ) ),
20. $branch2 );
21.
22. // Merge the two branches together and continue execution.
23. $merge = new ezcWorkflowNodeSimpleMerge();
24. $merge->addInNode( $branch1 );
25. $merge->addInNode( $branch2 );
26. $merge->addOutNode( $workflow->endNode );
Parents
ezcWorkflowNode
|
--ezcWorkflowNodeMerge
|
--ezcWorkflowNodeSimpleMerge
Inherited Constants
From
ezcWorkflowNode:
Inherited Member Variables
From
ezcWorkflowNodeMerge:
From
ezcWorkflowNode:
Inherited Methods
From
ezcWorkflowNodeMerge :
From
ezcWorkflowNode :
Last updated: Wed, 28 Nov 2007