Workflow: ezcWorkflowNodeAction
[ ]
[ Theoretical background ]
[ ]
[ ]
[ ]
[ ]
Class: ezcWorkflowNodeAction
|
An object of the ezcWorkflowNodeAction class represents an activity node holding business logic. [
source]
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:
1. <?php
2. class MyPrintAction implements ezcWorkflowServiceObject
3. {
4. private $whatToSay;
5.
6. public function __construct( $whatToSay )
7. {
8. $this->whatToSay = $whatToSay;
9. }
10.
11. public function execute( ezcWorkflowExecution $execution )
12. {
13. print $this->whatToSay;
14. return true; // we're finished, activate next node
15. }
16.
17. public function __toString()
18. {
19. return 'action description';
20. }
21. }
22.
23. $workflow = new ezcWorkflow( 'Test' );
24.
25. $action = new ezcWorkflowNodeAction( array( "class" => "MyPrintAction",
26. "arguments" => "No. 1 The larch!" ) );
27. $action->addOutNode( $workflow->endNode );
28. $workflow->startNode->addOutNode( $action );
29. ?>
Parents
ezcWorkflowNode
|
--ezcWorkflowNodeAction
Inherited Constants
From
ezcWorkflowNode:
Inherited Member Variables
From
ezcWorkflowNode:
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 :
Methods
__construct
ezcWorkflowNodeAction __construct(
mixed
$configuration )
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 |
|
Throws
| Class | Description |
ezcWorkflowDefinitionStorageException |
|
Redefinition of
createObject
Returns the service object as specified by the configuration.
Last updated: Thu, 03 Jul 2008