Workflow: ezcWorkflowNode
[ ]
[ Theoretical background ]
[ ]
[ ]
[ ]
[ ]
Class: ezcWorkflowNode
|
Abstract base class for workflow nodes. [
source]
Implemented Interfaces
All workflow nodes must extend this class.
Descendents
Constants
Member Variables
|
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 boolean |
$internalCall
= false
Flag that indicates whether an add*Node() or remove*Node() call is internal. This is necessary to avoid unlimited loops. |
|
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
accept
Reimplementation of accept() calls accept on all out nodes.
Parameters
activateNode
Convenience method for activating an (outgoing) node.
Parameters
addInNode
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. |
Throws
| Class | Description |
ezcWorkflowInvalidWorkflowException |
if the operation violates the constraints of the nodes involved. |
addOutNode
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. |
Throws
| Class | 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
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. |
Throws
| Class | Description |
ezcWorkflowInvalidWorkflowException |
if the operation violates the constraints of the nodes involved. |
removeOutNode
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. |
Throws
| Class | 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.
Throws
| Class | Description |
ezcWorkflowInvalidWorkflowException |
if the constraints of this node are not met. |
Redefined in descendants as
Last updated: Mon, 21 Dec 2009