PHP Class ezcWorkflowNodeSubWorkflow, Workflow
When the node is reached during execution of the workflow, the specified sub-workflow
is started. The original workflow is suspended until the sub-workflow has finished executing.
Incoming nodes: 1
Outgoing nodes: 1
The example below creates a sub-workflow node that passes the parent
execution's variable 'x' to the variable 'y' in the child execution when the
sub-workflow is started. When it ends, the child execution's 'y' variable is
passed to the parent execution as 'z'.
'IncrementVariable',
'variables' => array(
'in' => array(
'x' => 'y'
),
'out' => array(
'y' => 'z'
)
)
)
);
?>
Mostrar archivo
Open project: zetacomponents/workflow
Class Usage Examples
Protected Properties
Property |
Type |
Description |
|
$state |
integer |
Execution ID of the sub workflow,
0 if it has not been started yet. |
|
Public Methods
Method |
Description |
|
__construct ( mixed $configuration ) |
Constructs a new sub workflow with the configuration $configuration. |
|
__toString ( ) : string |
Returns a textual representation of this node. |
|
configurationFromXML ( DOMElement $element ) : array |
Generate node configuration from XML representation. |
|
configurationToXML ( DOMElement $element ) |
Generate XML representation of this node's configuration. |
|
execute ( ezcWorkflowExecution $execution ) : boolean |
Executes this node. |
|
Protected Methods
Method |
Description |
|
passVariables ( ezcWorkflowExecution $from, ezcWorkflowExecution $to, array $variables ) |
Passes variables from one execution context to another. |
|
Method Details
__construct()
public method
Configuration format
-
String:
The name of the workflow to execute. The workflow is loaded using the
loadByName method on the execution engine.
-
Array:
- workflow: The name of the workflow to execute. The workflow
is loaded using the loadByName method on the execution engine.
- variables: An array with the information for mapping
workflow variables between parent and child workflow execution.
-
__toString()
public method
Returns a textual representation of this node.
configurationFromXML()
public static method
Generate node configuration from XML representation.
configurationToXML()
public method
Generate XML representation of this node's configuration.
public execute ( ezcWorkflowExecution $execution ) : boolean |
$execution |
ezcWorkflowExecution |
|
return |
boolean |
true when the node finished execution,
and false otherwise |
passVariables()
protected method
Passes variables from one execution context to another.
protected passVariables ( ezcWorkflowExecution $from, ezcWorkflowExecution $to, array $variables ) |
$from |
ezcWorkflowExecution |
The execution context the variables are passed from. |
$to |
ezcWorkflowExecution |
The execution context the variables are passed to. |
$variables |
array |
The names of the variables. |
Property Details
$state protected_oe property
Execution ID of the sub workflow,
0 if it has not been started yet.
protected int $state |
return |
integer |
|