Workflow: ezcWorkflowNodeMultiChoice
[ ]
[ ]
[ ]
[ ]
[ ]
Class: ezcWorkflowNodeMultiChoice
|
This node implements the Multi-Choice workflow pattern. [
source]
The Multi-Choice workflow pattern defines multiple possible paths for the workflow of which one or more are chosen. It is a generalization of the Parallel Split and Exclusive Choice workflow patterns.
Incoming nodes: 1 Outgoing nodes: 2..*
This example displays how you can use ezcWorkflowNodeMultiChoice to activate one or more branches depending on the input. Note that an input value of 5 will start only branch 1 while an input value of 11 or more will start both branch1 and branch2.
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
|
--ezcWorkflowNodeBranch
|
--ezcWorkflowNodeConditionalBranch
|
--ezcWorkflowNodeMultiChoice
Inherited Constants
From
ezcWorkflowNode:
Inherited Member Variables
From
ezcWorkflowNodeConditionalBranch:
From
ezcWorkflowNodeBranch:
From
ezcWorkflowNode:
Inherited Methods
From
ezcWorkflowNodeConditionalBranch :
From
ezcWorkflowNodeBranch :
From
ezcWorkflowNode :
Last updated: Wed, 28 Nov 2007