blob: 9ff8326b83ae53d8d13e19f7bcb18d00872d83b3 [file] [log] [blame]
<?php
/**
* File containing the ezcWorkflowNodeMultiChoice class.
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
* @package Workflow
* @version //autogen//
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
*/
/**
* This node implements the Multi-Choice workflow pattern.
*
* 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.
*
* <code>
* <?php
* $workflow = new ezcWorkflow( 'Test' );
*
* // wait for input into the workflow variable value.
* $input = new ezcWorkflowNodeInput( array( 'value' => new ezcWorkflowConditionIsInt ) );
* $workflow->startNode->addOutNode( $input );
*
* // create the exclusive choice branching node
* $choice = new ezcWorkflowNodeMultiChoice;
* $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 ezcWorkflowConditionGreaterThan( 1 ) ),
* $branch1 );
* $choice->addConditionalOutNode( new ezcWorkflowConditionVariable( 'value',
* new ezcWorkflowConditionGreaterThan( 10 ) ),
* $branch2 );
*
* // Merge the two branches together and continue execution.
* $merge = new ezcWorkflowNodeSynchronizingMerge();
* $merge->addInNode( $branch1 );
* $merge->addInNode( $branch2 );
* $merge->addOutNode( $workflow->endNode );
* ?>
* </code>
*
* @package Workflow
* @version //autogen//
*/
class ezcWorkflowNodeMultiChoice extends ezcWorkflowNodeConditionalBranch
{
}
?>