Zeta Components - high quality PHP components

Zeta Components Manual :: Docs For Class ezcWorkflowNode

Workflow::ezcWorkflowNode

Class ezcWorkflowNode

Abstract base class for workflow nodes.

All workflow nodes must extend this class.

Source for this file: /Workflow/src/interfaces/node.php

Implements interfaces:

Version:   //autogen//

Descendants

Child Class Description
ezcWorkflowNodeAction An object of the ezcWorkflowNodeAction class represents an activity node holding business logic.
ezcWorkflowNodeStart An object of the ezcWorkflowNodeStart class represents the one and only tart node of a workflow. The execution of the workflow starts here.
ezcWorkflowNodeVariableUnset An object of the ezcWorkflowNodeVariableUnset class unset the specified workflow variable.
ezcWorkflowNodeInput An object of the ezcWorkflowNodeInput class represents an input (from the application) node.
ezcWorkflowNodeVariableSet An object of the ezcWorkflowNodeVariableSet class sets the specified workflow variable to a given value.
ezcWorkflowNodeSubWorkflow An object of the ezcWorkflowNodeSubWorkflow class represents a sub-workflow.
ezcWorkflowNodeEnd An object of the ezcWorkflowNodeEnd class represents an end node of a workflow.
ezcWorkflowNodeBranch Base class for nodes that branch multiple threads of execution.
ezcWorkflowNodeArithmeticBase Base class for nodes that implement simple integer arithmetic.
ezcWorkflowNodeMerge Base class for nodes that merge multiple threads of execution.

Constants

WAITING_FOR_ACTIVATION = 0 The node is waiting to be activated.
WAITING_FOR_EXECUTION = 1 The node is activated and waiting to be executed.

Member Variables

protected static boolean $internalCall
Flag that indicates whether an add*Node() or remove*Node() call is internal. This is necessary to avoid unlimited loops.
protected ezcWorkflowNode[] $activatedFrom = array()
The node(s) that activated this node.
protected integer $activationState
The state of this node.
protected array( $configuration
The configuration of this node.

The configuration is a structured (hash) array with the various options of the implemented node.

This functionality is implemented as an array to make it possible to have the storage engines unaware of the node classes.

protected integer $id = false
Unique ID of this node.

Only available when the workflow this node belongs to has been loaded from or saved to the data storage.

protected array( $inNodes = array()
The incoming nodes of this node.
protected integer $maxInNodes = 1
Constraint: The maximum number of incoming nodes this node has to have to be valid. Set to false to disable this constraint.
protected integer $maxOutNodes = 1
Constraint: The maximum number of outgoing nodes this node has to have to be valid. Set to false to disable this constraint.
protected integer $minInNodes = 1
Constraint: The minimum number of incoming nodes this node has to have to be valid. Set to false to disable this constraint.
protected integer $minOutNodes = 1
Constraint: The minimum number of outgoing nodes this node has to have to be valid. Set to false to disable this constraint.
protected integer $numInNodes = 0
The number of incoming nodes.
protected integer $numOutNodes = 0
The number of outgoing nodes.
protected array( $outNodes = array()
The outgoing nodes of this node.
protected mixed $state = null
The state of this node.
protected integer $threadId = null
The id of the thread this node is executing in.

Method Summary

public ezcWorkflowNode __construct( [ $configuration = null] )
Constructs a new node with the configuration $configuration.
public void accept( $visitor )
Reimplementation of accept() calls accept on all out nodes.
protected void activateNode( $execution , $node )
Convenience method for activating an (outgoing) node.
public ezcWorkflowNode addInNode( $node )
Adds a node to the incoming nodes of this node.
public ezcWorkflowNode addOutNode( $node )
Adds a node to the outgoing nodes of this node.
public mixed getConfiguration( )
Returns the configuration of this node.
public ezcWorkflowNode[] getInNodes( )
Returns the incoming nodes of this node.
public ezcWorkflowNode[] getOutNodes( )
Returns the outgoing nodes of this node.
public boolean removeInNode( $node )
Removes a node from the incoming nodes of this node.
public boolean removeOutNode( $node )
Removes a node from the outgoing nodes of this node.
public void verify( )
Checks this node's constraints.

Methods

__construct

ezcWorkflowNode __construct( [mixed $configuration = null] )

Constructs a new node with the configuration $configuration.

The configuration is a structured (hash) array. Implementations must pass their complete configuration on to this object. We have chosen to use structured arrays for the configuration since it simplifies the process of creating new node types and storing workflows.

Parameters:
Name Type Description
$configuration mixed
Redefined in descendants as:
Method Description
ezcWorkflowNodeAction::__construct() Constructs a new action node with the configuration $configuration. 
ezcWorkflowNodeVariableUnset::__construct() Constructs a new unset node. 
ezcWorkflowNodeInput::__construct() Constructs a new input node. 
ezcWorkflowNodeVariableSet::__construct() Constructs a new variable set node with the configuration $configuration. 
ezcWorkflowNodeSubWorkflow::__construct() Constructs a new sub workflow with the configuration $configuration. 
ezcWorkflowNodeArithmeticBase::__construct() Constructs a new action node with the configuration $configuration. 

accept

void accept( ezcWorkflowVisitor $visitor )

Reimplementation of accept() calls accept on all out nodes.

Parameters:
Name Type Description
$visitor ezcWorkflowVisitor
Implementation of:
Method Description
ezcWorkflowVisitable::accept() Accepts the visitor.

activateNode

void activateNode( ezcWorkflowExecution $execution , ezcWorkflowNode $node )

Convenience method for activating an (outgoing) node.

Parameters:
Name Type Description
$execution ezcWorkflowExecution
$node ezcWorkflowNode

addInNode

ezcWorkflowNode addInNode( ezcWorkflowNode $node )

Adds a node to the incoming nodes of this node.

Automatically adds $node to the workflow and adds this node as an out node of $node.

Parameters:
Name Type Description
$node ezcWorkflowNode The node that is to be added as incoming node.
Exceptions:
Type Description
ezcWorkflowInvalidWorkflowException if the operation violates the constraints of the nodes involved.

addOutNode

ezcWorkflowNode addOutNode( ezcWorkflowNode $node )

Adds a node to the outgoing nodes of this node.

Automatically adds $node to the workflow and adds this node as an in node of $node.

Parameters:
Name Type Description
$node ezcWorkflowNode The node that is to be added as outgoing node.
Exceptions:
Type Description
ezcWorkflowInvalidWorkflowException if the operation violates the constraints of the nodes involved.

getConfiguration

mixed getConfiguration( )

Returns the configuration of this node.

getInNodes

ezcWorkflowNode[] getInNodes( )

Returns the incoming nodes of this node.

getOutNodes

ezcWorkflowNode[] getOutNodes( )

Returns the outgoing nodes of this node.

removeInNode

boolean removeInNode( ezcWorkflowNode $node )

Removes a node from the incoming nodes of this node.

Automatically removes $this as an out node of $node.

Parameters:
Name Type Description
$node ezcWorkflowNode The node that is to be removed as incoming node.
Exceptions:
Type Description
ezcWorkflowInvalidWorkflowException if the operation violates the constraints of the nodes involved.

removeOutNode

boolean removeOutNode( ezcWorkflowNode $node )

Removes a node from the outgoing nodes of this node.

Automatically removes $this as an in node of $node.

Parameters:
Name Type Description
$node ezcWorkflowNode The node that is to be removed as outgoing node.
Exceptions:
Type Description
ezcWorkflowInvalidWorkflowException if the operation violates the constraints of the nodes involved.

verify

void verify( )

Checks this node's constraints.

The constraints checked are the minimum in nodes maximum in nodes, minimum out nodes and maximum out nodes.

Exceptions:
Type Description
ezcWorkflowInvalidWorkflowException if the constraints of this node are not met.
Redefined in descendants as:
Method Description
ezcWorkflowNodeConditionalBranch::verify() Checks this node's constraints. 
Documentation generated by phpDocumentor 1.4.3