Workflow: ezcWorkflowNode
[ ]
[ ]
[ ]
[ ]
[ ]
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 mixed |
$configuration
The configuration of this node. |
|
protected integer |
$id
= false
Unique ID of this node. |
|
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. |
|
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
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 static void |
configurationFromXML(
$element )
Generate node configuration from XML representation. |
|
public void |
configurationToXML(
$element )
Generate XML representation of this node's configuration. |
|
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. |
|
protected void |
initState(
)
Initializes the state 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. |
configurationFromXML
void configurationFromXML(
$element )
Generate node configuration from XML representation.
Parameters
| Name |
Type |
Description |
$element |
DOMElement |
|
Redefined in descendants as
configurationToXML
void configurationToXML(
$element )
Generate XML representation of this node's configuration.
Parameters
| Name |
Type |
Description |
$element |
DOMElement |
|
Redefined in descendants as
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.
initState
void initState(
)
Initializes the state of this node.
Redefined in descendants as
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: Wed, 28 Nov 2007