PHP Class raoul2000\workflow\source\file\GraphmlLoader

Inheritance: extends WorkflowDefinitionLoader
Show file Open project: raoul2000/yii2-workflow Class Usage Examples

Public Properties

Property Type Description
$path path where the graphml file to load is located

Public Methods

Method Description
convert ( string $graphmlFile ) Convert a graphml file describing a workflow into an array suitable to create a workflow object.
createFilename ( string $workflowId ) : string creates and returns the filename where the workflow $workflowId is stored.
loadDefinition ( string $workflowId, IWorkflowSource $source ) : array Loads the definition of the workflow whose id is passed as argument.

Private Methods

Method Description
collectNodes ( ) : [] Extract nodes defined in the graphml input file.
When working with yEd, remember that the node 'label' is used as the node id by workflow.
collectTransitions ( ) : [] Extract edges defined in the graphml input file
collectWorkflowProperties ( )
createWorkflowDefinition ( [] $w, [] $n, [] $e ) Merges all arrays extracted from the graphml file (workflow, nodes, edges) to create and return a single array descrbing a workflow.
extractYedProperties ( ) Retrieve the graphml id attribute for each named properties defines in the _mapper array.
isBlank ( string $str ) : boolean

Method Details

convert() public method

Convert a graphml file describing a workflow into an array suitable to create a workflow object.
public convert ( string $graphmlFile )
$graphmlFile string the path to the graphml file to process

createFilename() public method

The filename is built using the [[path]] property, the workflow id itself, and *graphml* extension.
public createFilename ( string $workflowId ) : string
$workflowId string the workflow id
return string the filename

loadDefinition() public method

Loads the definition of the workflow whose id is passed as argument.
public loadDefinition ( string $workflowId, IWorkflowSource $source ) : array
$workflowId string
$source IWorkflowSource the workflow source component
return array the workflow definition

Property Details

$path public property

path where the graphml file to load is located
public $path