simpleWorkflow
  • Class
  • Tree

Classes

  • SWActiveRecord
  • SWActiveRecordBehavior
  • SWComponent
  • SWEvent
  • SWException
  • SWHelper
  • SWNode
  • SWPhpWorkflowSource
  • SWValidator
  • SWWorkflowSource
  • SWyEdConverter
  • SWyEdConverterDOM

Class SWPhpWorkflowSource

This class gives access to workflow and statuses stored as PHP files. Following attributes can be initialized when the component is configured:
  • basePath (string) : the base path alias where all workflow are stored.By default, it is set to application.models.workflows (folder "protected/models/workflows").
  • definitionType (string) : Defines the type of PHP file to load. A Workflow can be defined in a PHP file that contains a simple array definition (definitionType = 'array'), or by a class (definitionType = 'class'). By default this attribute is set to 'array'.
CApplicationComponent
Extended by SWWorkflowSource
Extended by SWPhpWorkflowSource
Located at SWPhpWorkflowSource.php

Methods summary

public
# init( )

Initialize the component with configured values. To preload workflows, set configuration setting 'preload' to an array containing all workflows to preload. If no preload is set workflows are loaded on demand.

Initialize the component with configured values. To preload workflows, set configuration setting 'preload' to an array containing all workflows to preload. If no preload is set workflows are loaded on demand.

See

SWWorkflowSource
public boolean
# isWorkflowLoaded( string $workflowId )

Verify if a workflow has been loaded.

Verify if a workflow has been loaded.

Parameters

$workflowId
string
$workflowId workflow id

Returns

boolean
TRUE if the workflow whose id is $workflowId has already been loaded, FALSE otherwise
public
# loadWorkflow( string $workflowId, boolean $forceReload = false )

Loads the workflow whose id is passed as argument. By default, if the workflow has already been loaded it is not reloaded unless $forceReload is TRUE

Loads the workflow whose id is passed as argument. By default, if the workflow has already been loaded it is not reloaded unless $forceReload is TRUE

Parameters

$workflowId
string
$workflowId the workflow id
$forceReload
boolean
$forceReload TRUE to force workflow loading, FALSE otherwise
public
# addWorkflow( array $definition, string $id )

This method is used to add a new workflow definition to the current workflow collection.

This method is used to add a new workflow definition to the current workflow collection.

Parameters

$definition
array
$definition the workflow definition in its array form
$id
string
$id the workflow id
public SWNode
# getNodeDefinition( mixed $node, mixed $defaultWorkflowId = null )

(non-PHPdoc)

(non-PHPdoc)

Parameters

$node
mixed
node String or SWNode object to look for
$defaultWorkflowId

Returns

SWNode
the node as it is defined in a workflow, or NULL if not found

See

SWWorkflowSource::getNodeDefinition()
public array
# getNextNodes( mixed $sourceNode, mixed $workflowId = null )

(non-PHPdoc)

(non-PHPdoc)

Returns

array
SWNode array

See

SWWorkflowSource::getNextNodes()
public boolean
# isNextNode( mixed $sourceNode, mixed $targetNode, mixed $workflowId = null )

(non-PHPdoc)

(non-PHPdoc)

Parameters

$sourceNode
mixed
$sourceNode can be provided as a SWNode object, or as a string that can contain a workflowId or not.
$targetNode
mixed
$targetNode target node to test
$workflowId

Returns

boolean
true if $nextStatus can be reached from $startStatus

See

SWWorkflowSource::isNextNode()
public SWnode
# getInitialNode( mixed $workflowId )

(non-PHPdoc)

(non-PHPdoc)

Returns

SWnode
initial node for $workflowId

See

SWWorkflowSource::getInitialNode()
public array
# getAllNodes( string $workflowId )

(non-PHPdoc)

(non-PHPdoc)

Parameters

$workflowId
string
$workflowId id of the workflow that owns all nodes returned

Returns

array
all nodes belonging to workflow $workflowId

See

SWWorkflowSource::getAllNodes()

Methods inherited from SWWorkflowSource

createSWNode()

Magic methods summary

Properties summary

public string $basePath
#

the base path alias where all workflow are stored.By default, it is set to application.models.workflows (folder "protected/models/workflows").

the base path alias where all workflow are stored.By default, it is set to application.models.workflows (folder "protected/models/workflows").

public string $definitionType
#

Definition type for workflow. Allowed values are : class, array. Default is 'array'

Definition type for workflow. Allowed values are : class, array. Default is 'array'

Properties inherited from SWWorkflowSource

$preload, $workflowNamePrefix

simpleWorkflow API documentation generated by ApiGen 2.8.0