Workflow: ezcWorkflowNodeExclusiveChoice
[ ]
[ ]
[ ]
[ ]
[ ]
Class: ezcWorkflowNodeExclusiveChoice
|
This node implements the Exclusive Choice workflow pattern. [
source]
The Exclusive Choice workflow pattern defines multiple possible paths for the workflow of which exactly one is chosen based on the conditions set for the out nodes.
Incoming nodes: 1 Outgoing nodes: 2..*
This example displays how you can use an exclusive choice to select one of two possible branches depending on the workflow variable 'value' which is read using an input node.
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 ezcWorkflowConditionGreaterThan( 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
|
--ezcWorkflowNodeBranch
|
--ezcWorkflowNodeConditionalBranch
|
--ezcWorkflowNodeExclusiveChoice
Inherited Constants
From
ezcWorkflowNode:
Member Variables
|
protected integer |
$maxActivatedConditionalOutNodes
= 1
Constraint: The maximum number of conditional outgoing nodes this node may activate. Set to false to disable this constraint. |
|
protected integer |
$minActivatedConditionalOutNodes
= 1
Constraint: The minimum number of conditional outgoing nodes this node has to activate. Set to false to disable this constraint. |
|
protected integer |
$minConditionalOutNodes
= 2
Constraint: The minimum number of conditional outgoing nodes this node has to have. Set to false to disable this constraint. |
Inherited Member Variables
From
ezcWorkflowNodeConditionalBranch:
From
ezcWorkflowNodeBranch:
From
ezcWorkflowNode:
Inherited Methods
From
ezcWorkflowNodeConditionalBranch :
From
ezcWorkflowNodeBranch :
From
ezcWorkflowNode :
Last updated: Thu, 01 Nov 2007