PHP 클래스 ezcWorkflowNodeDiscriminator, Workflow

The Discriminator workflow pattern can be applied when the assumption made for the Simple Merge workflow pattern does not hold. It can deal with merge situations where multiple incoming branches may run in parallel. It activates its outgoing node after being activated by the first incoming branch and then waits for all remaining branches to complete before it resets itself. After the reset the Discriminator can be triggered again. Use Case Example: To improve response time, an action is delegated to several distributed servers. The first response proceeds the flow, the other responses are ignored. Incoming nodes: 2..* Outgoing nodes: 1 This example creates a workflow that splits in two parallel threads which are joined again using a ezcWorkflowNodeDiscriminator. startNode->addOutNode( $split ); $nodeExec1 = ....; // create nodes for the first thread of execution here.. $nodeExec2 = ....; // create nodes for the second thread of execution here.. $disc = new ezcWorkflowNodeDiscriminator(); $disc->addInNode( $nodeExec1 ); $disc->addInNode( $nodeExec2 ); $disc->addOutNode( $workflow->endNode ); ?>
상속: extends ezcWorkflowNodeMerge
파일 보기 프로젝트 열기: zetacomponents/workflow 1 사용 예제들

공개 메소드들

메소드 설명
activate ( ezcWorkflowExecution $execution, ezcWorkflowNode $activatedFrom = null, integer $threadId ) Activate this node.
execute ( ezcWorkflowExecution $execution ) : boolean Executes this node.

메소드 상세

activate() 공개 메소드

Activate this node.
public activate ( ezcWorkflowExecution $execution, ezcWorkflowNode $activatedFrom = null, integer $threadId )
$execution ezcWorkflowExecution
$activatedFrom ezcWorkflowNode
$threadId integer

execute() 공개 메소드

Executes this node.
public execute ( ezcWorkflowExecution $execution ) : boolean
$execution ezcWorkflowExecution
리턴 boolean true when the node finished execution, and false otherwise