Class SWWorkflowSource
This is the base class for all workflow source implementations. It provides
basic initialization features and a set of methods that must be implemented by
workflow source classes.
- CApplicationComponent
- SWWorkflowSource
Direct known subclasses
Methods summary
public
|
#
createSWNode( mixed $node, mixed $workflowId )
Create and returns a SWNode object. The SWNode returned doesn't have to be
defined in a workflow currently loaded. |
abstract public
|
#
addWorkflow( array $definition, string $id )
Add a workflow to the internal workflow collection. The definition of the workflow to add is provided in the $definition argument as an associative array. This method is used for instance when a workflow definition is provided by a model and not by a php file or another source. If a workflow with the same id is already loaded, it is not over written. |
abstract public
|
#
loadWorkflow( string $workflowId, boolean $forceReload = false )
Loads the workflow whose id is passed as argument from the source. If it was already loaded, then it is not reloaded unles $forceReload is set to TRUE. If the workflow could not be found, an exception is thrown. |
abstract public
|
#
getNodeDefinition( mixed $node, mixed $defaultWorkflowId = null )
Search for the node passed as argument in the workflow definition. Note that if this node is not found among the currently loaded workflows, this method will try to load the workflow it belongs to. |
abstract public
array
|
#
getNextNodes( mixed $sourceNode, mixed $workflowId = null )
Returns an array containing all SWNode object for each status that can be reached from $startStatus. It does not evaluate node constraint but only the fact that a transition exist beteween $startStatus and nodes returned. If no nodes are found, an empty array is returned. An exception is thrown if $startStatus is not found among all worklows available. |
abstract public
boolean
|
#
isNextNode( mixed $sourceNode, mixed $targetNode, mixed $workflowId = null )
Checks if there is a transition between the two nodes passed as argument. |
abstract public
SWnode
|
#
getInitialNode( mixed $workflowId )
Returns the initial node defined for the workflow whose id is passed as
argument. A valid workflow must have one and only one initial status. If it's
note the case, workflow can't be loaded. |
abstract public
array
|
#
getAllNodes( string $workflowId )
Fetch all nodes belonging to the workflow whose Id is passed as argument. |
Magic methods summary
Properties summary
public
array
|
$preload |
#
list of workflow names that shoumd ne loaded when the component is initialized |
public
string
|
$workflowNamePrefix |
#
when a workflow name is automatically built from the model name, this prefix is added to the model name so to avoid clashes (e.g. model 'MyModel' is by default inserted into workflow 'swMyModel') |