Zeta Components Manual :: Docs For Class ezcWorkflowNodeAction
Workflow::ezcWorkflowNodeAction
Class ezcWorkflowNodeAction
An object of the ezcWorkflowNodeAction class represents an activity node holding business logic.
When the node is reached during execution of the workflow, the business logic that is implemented by the associated service object is executed.
Service objects can return true to resume execution of the workflow or false to suspend the workflow (unless there are other active nodes) and be re-executed later
Incoming nodes: 1 Outgoing nodes: 1
The following example displays how to create a workflow with a very simple service object that prints the argument it was given to the constructor:
- <?php
- class MyPrintAction implements ezcWorkflowServiceObject
- {
- private $whatToSay;
- public function __construct( $whatToSay )
- {
- $this->whatToSay = $whatToSay;
- }
- public function execute( ezcWorkflowExecution $execution )
- {
- print $this->whatToSay;
- return true; // we're finished, activate next node
- }
- public function __toString()
- {
- return 'action description';
- }
- }
- "arguments" => "No. 1 The larch!" ) );
- $action->addOutNode( $workflow->endNode );
- $workflow->startNode->addOutNode( $action );
- ?>
Source for this file: /Workflow/src/nodes/action.php
ezcWorkflowNode | --ezcWorkflowNodeAction
Version: | //autogen// |
Inherited Constants
From ezcWorkflowNode: | |
---|---|
ezcWorkflowNode::WAITING_FOR_ACTIVATION
|
The node is waiting to be activated. |
ezcWorkflowNode::WAITING_FOR_EXECUTION
|
The node is activated and waiting to be executed. |
Inherited Member Variables
From ezcWorkflowNode | |
---|---|
protected |
ezcWorkflowNode::$activatedFrom
|
protected |
ezcWorkflowNode::$activationState
|
protected |
ezcWorkflowNode::$configuration
|
protected |
ezcWorkflowNode::$id
|
protected |
ezcWorkflowNode::$inNodes
|
protected |
ezcWorkflowNode::$internalCall
|
protected |
ezcWorkflowNode::$maxInNodes
|
protected |
ezcWorkflowNode::$maxOutNodes
|
protected |
ezcWorkflowNode::$minInNodes
|
protected |
ezcWorkflowNode::$minOutNodes
|
protected |
ezcWorkflowNode::$numInNodes
|
protected |
ezcWorkflowNode::$numOutNodes
|
protected |
ezcWorkflowNode::$outNodes
|
protected |
ezcWorkflowNode::$state
|
protected |
ezcWorkflowNode::$threadId
|
Method Summary
public ezcWorkflowNodeAction |
__construct(
$configuration
)
Constructs a new action node with the configuration $configuration. |
protected ezcWorkflowServiceObject |
createObject(
)
Returns the service object as specified by the configuration. |
Inherited Methods
From ezcWorkflowNode | |
---|---|
public ezcWorkflowNode |
ezcWorkflowNode::__construct()
Constructs a new node with the configuration $configuration. |
public void |
ezcWorkflowNode::accept()
Reimplementation of accept() calls accept on all out nodes. |
protected void |
ezcWorkflowNode::activateNode()
Convenience method for activating an (outgoing) node. |
public ezcWorkflowNode |
ezcWorkflowNode::addInNode()
Adds a node to the incoming nodes of this node. |
public ezcWorkflowNode |
ezcWorkflowNode::addOutNode()
Adds a node to the outgoing nodes of this node. |
public mixed |
ezcWorkflowNode::getConfiguration()
Returns the configuration of this node. |
public ezcWorkflowNode[] |
ezcWorkflowNode::getInNodes()
Returns the incoming nodes of this node. |
public ezcWorkflowNode[] |
ezcWorkflowNode::getOutNodes()
Returns the outgoing nodes of this node. |
public boolean |
ezcWorkflowNode::removeInNode()
Removes a node from the incoming nodes of this node. |
public boolean |
ezcWorkflowNode::removeOutNode()
Removes a node from the outgoing nodes of this node. |
public void |
ezcWorkflowNode::verify()
Checks this node's constraints. |
Methods
__construct
Constructs a new action node with the configuration $configuration.
Configuration format
- String: The class name of the service object. Must implement ezcWorkflowServiceObject. No arguments are passed to the constructor.
- Array:
- class: The class name of the service object. Must implement ezcWorkflowServiceObject.
- arguments: Array of values that are passed to the constructor of the service object.
Parameters:
Name | Type | Description |
---|---|---|
$configuration |
mixed |
Exceptions:
Type | Description |
---|---|
ezcWorkflowDefinitionStorageException |
Redefinition of:
Method | Description |
---|---|
ezcWorkflowNode::__construct() |
Constructs a new node with the configuration $configuration. |
createObject
Returns the service object as specified by the configuration.