yii2-workflow Class Reference
  • Namespace
  • Class

Namespaces

  • raoul2000
    • workflow
      • actions
      • base
      • events
      • helpers
      • source
        • file
      • validation

Classes

  • DefaultArrayParser
  • GraphmlLoader
  • MinimalArrayParser
  • PhpArrayLoader
  • PhpClassLoader
  • WorkflowArrayParser
  • WorkflowDefinitionLoader
  • WorkflowFileSource

Interfaces

  • IWorkflowDefinitionProvider

Class WorkflowArrayParser

A WorkflowArrayParser object converts a workflow definition PHP array, into its normalized form as expected by the WorkflowFileSource class.

The normalized form implements following rules :

  • key initialStatusId : (mandatory) must contain a status Id defined in the status Id list
  • key status : (mandatory) status definition list - its value is an array where each key is a status Id and each value is the status configuration
  • all status Ids are absolute

example :

[
  'initialStatusId' => 'WID/A'
  'status' => [
      'WID/A' => [
          'transition' => [
              'WID/B' => []
              'WID/C' => []
          ]
      ]
      'WID/B' => null
      'WID/C' => null
  ]
]
yii\base\Object
Extended by raoul2000\workflow\source\file\WorkflowArrayParser

Direct known subclasses

raoul2000\workflow\source\file\DefaultArrayParser, raoul2000\workflow\source\file\MinimalArrayParser

Abstract
Namespace: raoul2000\workflow\source\file
Located at source/file/WorkflowArrayParser.php

Methods summary

abstract public array
# parse( string $wId, array $definition, raoul2000\workflow\source\file\WorkflowFileSource $source )

Parse a workflow defined as a PHP Array.

Parse a workflow defined as a PHP Array.

The workflow definition passed as argument is turned into an array that can be used by the WorkflowFileSource components.

Parameters

$wId
$definition
$source

Returns

array
The parse workflow array definition

Throws

raoul2000\workflow\base\WorkflowValidationException
public
# validate( string $wId, IWorkflowSource $source, string $initialStatusId, array $startStatusIdIndex, array $endStatusIdIndex )

Validates an array that contains a workflow definition.

Validates an array that contains a workflow definition.

Parameters

$wId
$source
$initialStatusId
$startStatusIdIndex
$endStatusIdIndex

Throws

raoul2000\workflow\base\WorkflowValidationException

Properties summary

public boolean $validate

when TRUE, the parse method performs some validations

when TRUE, the parse method performs some validations

# true
yii2-workflow Class Reference API documentation generated by ApiGen