Class representing a workflow.
Source for this file: /Workflow/src/workflow.php
Version: | //autogen// |
ezcWorkflowDefinitonStorage | read/write |
$definitionStorage
The definition handler used to fetch sub workflows on demand. This property is set automatically if you load a workflow using a workflow definition storage. |
ezcWorkflowNodeEnd | read |
$endNode
The default end node of the workflow. |
ezcWorkflowNodeFinally | read |
$finallyNode
The start of a node sequence that is executed when a workflow execution is cancelled. |
int | read/write |
$id
Unique ID set automatically by the definition handler when the workflow is stored. |
string | read/write |
$name
A unique name (accross the system) for this workflow. |
array(ezcWorkflowNode) | read |
$nodes
All the nodes of this workflow. |
ezcWorkflowNodeStart | read |
$startNode
The unique start node of the workflow. |
int | read/write |
$version
The version of the workflow. This must be incremented manually whenever you want a new version. |
protected array(string=>mixed) |
$properties
= array(
Container to hold the properties |
protected array |
$variableHandlers
= array()
The variable handlers of this workflow. |
public ezcWorkflow |
__construct(
$name
, [ $startNode
= null] , [ $endNode
= null] , [ $finallyNode
= null] )
Constructs a new workflow object with the name $name. |
public void |
accept(
$visitor
)
Overridden implementation of accept() calls accept on the start node. |
public void |
addVariableHandler(
$variableName
, $className
)
Sets the class $className to handle the variable named $variableName. |
public integer |
count(
)
Returns the number of nodes of this workflow. |
public array |
getVariableHandlers(
)
Returns the variable handlers. |
public boolean |
hasSubWorkflows(
)
Returns true when the workflow has sub workflows (ie. when it contains ezcWorkflowNodeSubWorkflow nodes) and false otherwise. |
public boolean |
isInteractive(
)
Returns true when the workflow requires user interaction (ie. when it contains ezcWorkflowNodeInput nodes) and false otherwise. |
public boolean |
removeVariableHandler(
$variableName
)
Removes the handler for $variableName and returns true on success. |
public void |
reset(
)
Resets the nodes of this workflow. |
public void |
setVariableHandlers(
$variableHandlers
)
Sets handlers for multiple variables. |
public void |
verify(
)
Verifies the specification of this workflow. |
Constructs a new workflow object with the name $name.
Use $startNode and $endNode parameters if you don't want to use the default start and end nodes.
$name must uniquely identify the workflow within the system.
Name | Type | Description |
---|---|---|
$name |
string | The name of the workflow. |
$startNode |
ezcWorkflowNodeStart | The start node of the workflow. |
$endNode |
ezcWorkflowNodeEnd | The default end node of the workflow. |
$finallyNode |
ezcWorkflowNodeFinally | The start of a node sequence that is executed when a workflow execution is cancelled. |
Overridden implementation of accept() calls accept on the start node.
Name | Type | Description |
---|---|---|
$visitor |
ezcWorkflowVisitor |
Method | Description |
---|---|
ezcWorkflowVisitable::accept() |
Accepts the visitor. |
Sets the class $className to handle the variable named $variableName.
$className must be the name of a class implementing the ezcWorkflowVariableHandler interface.
Name | Type | Description |
---|---|---|
$variableName |
string | |
$className |
string |
Type | Description |
---|---|
ezcWorkflowInvalidWorkflowException |
if $className does not contain the name of a valid class implementing ezcWorkflowVariableHandler |
Returns the number of nodes of this workflow.
Method | Description |
---|---|
Countable::count |
Returns the variable handlers.
The format of the returned array is array( 'variableName' => ezcWorkflowVariableHandler )
Returns true when the workflow has sub workflows (ie. when it contains ezcWorkflowNodeSubWorkflow nodes) and false otherwise.
Returns true when the workflow requires user interaction (ie. when it contains ezcWorkflowNodeInput nodes) and false otherwise.
Removes the handler for $variableName and returns true on success.
Returns false if no handler was set for $variableName.
Name | Type | Description |
---|---|---|
$variableName |
string |
Resets the nodes of this workflow.
See the documentation of ezcWorkflowVisitorReset for details.
Sets handlers for multiple variables.
The format of $variableHandlers is array( 'variableName' => ezcWorkflowVariableHandler )
Name | Type | Description |
---|---|---|
$variableHandlers |
array |
Type | Description |
---|---|
ezcWorkflowInvalidWorkflowException |
if $className does not contain the name of a valid class implementing ezcWorkflowVariableHandler |
Verifies the specification of this workflow.
See the documentation of ezcWorkflowVisitorVerification for details.
Type | Description |
---|---|
ezcWorkflowInvalidWorkflowException |
if the specification of this workflow is not correct. |