Path

ez components / documentation / api reference / 2007.1.1 / workflow


eZ Components 2007.1.1

Workflow: ezcWorkflowNodeMultiChoice

[ Tutorial ] [ Class tree ] [ Element index ] [ ChangeLog ] [ Credits ]

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 ezcWorkflowNodeInputarray'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->addConditionalOutNodenew ezcWorkflowConditionVariable'value',
16.                                                                   new ezcWorkflowConditionGreaterThan) ),
17.                                 $branch1 );
18.  $choice->addConditionalOutNodenew ezcWorkflowConditionVariable'value',
19.                                                                   new ezcWorkflowConditionGreaterThan10 ) ),
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:
ezcWorkflowNode::WAITING_FOR_ACTIVATION    The node is waiting to be activated.
ezcWorkflowNode::WAITING_FOR_EXECUTION    The node is activated and waiting to be executed.

Inherited Member Variables

From ezcWorkflowNodeConditionalBranch:
protected  ezcWorkflowNodeConditionalBranch::$configuration
protected  ezcWorkflowNodeConditionalBranch::$maxActivatedConditionalOutNodes
protected  ezcWorkflowNodeConditionalBranch::$maxConditionalOutNodes
protected  ezcWorkflowNodeConditionalBranch::$minActivatedConditionalOutNodes
protected  ezcWorkflowNodeConditionalBranch::$minConditionalOutNodes
From ezcWorkflowNodeBranch:
protected  ezcWorkflowNodeBranch::$maxInNodes
protected  ezcWorkflowNodeBranch::$maxOutNodes
protected  ezcWorkflowNodeBranch::$minOutNodes
From ezcWorkflowNode:
protected  ezcWorkflowNode::$activatedFrom
protected  ezcWorkflowNode::$activationState
protected  ezcWorkflowNode::$id
protected  ezcWorkflowNode::$inNodes
protected  ezcWorkflowNode::$internalCall
protected  ezcWorkflowNode::$minInNodes
protected  ezcWorkflowNode::$numInNodes
protected  ezcWorkflowNode::$numOutNodes
protected  ezcWorkflowNode::$outNodes
protected  ezcWorkflowNode::$state
protected  ezcWorkflowNode::$threadId

Inherited Methods

From ezcWorkflowNodeConditionalBranch :
public ezcWorkflowNode ezcWorkflowNodeConditionalBranch::addConditionalOutNode()
Adds the conditional outgoing node $outNode to this node with the condition $condition.
public void ezcWorkflowNodeConditionalBranch::verify()
Checks this node's constraints.
From ezcWorkflowNodeBranch :
protected void ezcWorkflowNodeBranch::activateOutgoingNodes()
Activates this node's outgoing nodes.
From ezcWorkflowNode :
public ezcWorkflowNode ezcWorkflowNode::__construct()
Constructs a new node with the configuration $configuration.
public void ezcWorkflowNode::accept()
Reimplementation of accept() calls accept on all out nodes.
protected void ezcWorkflowNode::activateNode()
Convenience method for activating an (outgoing) node.
public ezcWorkflowNode ezcWorkflowNode::addInNode()
Adds a node to the incoming nodes of this node.
public ezcWorkflowNode ezcWorkflowNode::addOutNode()
Adds a node to the outgoing nodes of this node.
public mixed ezcWorkflowNode::getConfiguration()
Returns the configuration of this node.
public ezcWorkflowNode[] ezcWorkflowNode::getInNodes()
Returns the incoming nodes of this node.
public ezcWorkflowNode[] ezcWorkflowNode::getOutNodes()
Returns the outgoing nodes of this node.
protected void ezcWorkflowNode::initState()
Initializes the state of this node.
public boolean ezcWorkflowNode::removeInNode()
Removes a node from the incoming nodes of this node.
public boolean ezcWorkflowNode::removeOutNode()
Removes a node from the outgoing nodes of this node.
public void ezcWorkflowNode::verify()
Checks this node's constraints.
Last updated: Wed, 28 Nov 2007