* new ezcWorkflowConditionIsInt ) ); * $workflow->startNode->addOutNode( $input ); * * // create the exclusive choice branching node * $choice = new ezcWorkflowNodeExclusiveChoice; * $intput->addOutNode( $choice ); * * $branch1 = ....; // create nodes for the first branch of execution here.. * $branch2 = ....; // create nodes for the second branch of execution here.. * * // add the outnodes and set the conditions on the exclusive choice * $choice->addConditionalOutNode( new ezcWorkflowConditionVariable( 'value', * new ezcWorkflowConditionGreatherThan( 10 ) ), * $branch1 ); * $choice->addConditionalOutNode( new ezcWorkflowConditionVariable( 'value', * new ezcWorkflowConditionLessThan( 11 ) ), * $branch2 ); * * // Merge the two branches together and continue execution. * $merge = new ezcWorkflowNodeSimpleMerge(); * $merge->addInNode( $branch1 ); * $merge->addInNode( $branch2 ); * $merge->addOutNode( $workflow->endNode ); * ?> * * * @package Workflow * @version //autogen// */ class ezcWorkflowNodeSimpleMerge extends ezcWorkflowNodeMerge { /** * Activate this node. * * @param ezcWorkflowExecution $execution * @param ezcWorkflowNode $activatedFrom * @param int $threadId * @ignore */ public function activate( ezcWorkflowExecution $execution, ezcWorkflowNode $activatedFrom = null, $threadId = 0 ) { $parentThreadId = $execution->getParentThreadId( $threadId ); if ( empty( $this->state['threads'] ) ) { $this->state['threads'][] = $threadId; parent::activate( $execution, $activatedFrom, $parentThreadId ); } } /** * Executes this node. * * @param ezcWorkflowExecution $execution * @return boolean true when the node finished execution, * and false otherwise * @ignore */ public function execute( ezcWorkflowExecution $execution ) { return $this->doMerge( $execution ); } } ?>