libSmalldb  v0.7-66-gb94d22a
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
BpmnReader Class Reference

Description

BPMN reader.

Read BPMN diagram and create state machine which implements given business proces. When multiple BPMN loaders used, the final state machine will implement all of the business processes.

The first step is to load all BPMN diagrams, but not to update state machine definition. The second step is performed during machine definition postprocessing, when all BPMN diagrams are combined together and state machine definition is generated.

Options:

See also
https://camunda.org/bpmn/tool/

Inheritance diagram for BpmnReader

Public Member Functions

 isSupported (string $file_extension)
 Return true if the file looks parsable by this reader. More...
 
 loadString (string $machine_type, string $data_string, array $options=[], string $filename=null)
 Parse string and return fragment of state machine definition. More...
 
 postprocessDefinition (string $machine_type, array & $machine_def, array & $errors)
 If reader was invoked, it may need to postprocess the definition when everything is loaded (after last loadString call is completed). More...
 

Public Attributes

 $disableSvgFile = false
 
 $rewriteGraph = false
 

Protected Member Functions

 inferStateMachine (Graph $graph, string $state_machine_participant_id, string $state_machine_process_id)
 
 renderBpmn ($prefix, $fragment_file, $fragment, $errors)
 
 renderBpmnJson (array & $machine_def, $prefix, $fragment_file, $fragment, $errors)
 

Member Function Documentation

◆ isSupported()

isSupported ( string  $file_extension)

Return true if the file looks parsable by this reader.

Parameters
string$file_extensionFile extension including leading dot (e.g. ".json")
Returns
bool

Implements IMachineDefinitionReader.

◆ loadString()

loadString ( string  $machine_type,
string  $data_string,
array  $options = [],
string  $filename = null 
)

Parse string and return fragment of state machine definition.

Parameters
string$machine_typeName of state machine (for better error messages)
string$data_stringData to parse.
array$optionsAdditional options specified in master definition.
string$filenameName of the file (or similar identifier) - only for debug messages.
Returns
array - Fragment of machine definition.
See also
Graph[] $processNestedGraphs
$el
$el
$el
$el

Implements IMachineDefinitionReader.

◆ postprocessDefinition()

postprocessDefinition ( string  $machine_type,
array &  $machine_def,
array &  $errors 
)

If reader was invoked, it may need to postprocess the definition when everything is loaded (after last loadString call is completed).

Postprocessing is invoked only once, even when loadString has been invoked multiple times.

Parameters
string$machine_typeName of state machine (for better error messages)
array$machine_defMachine definition to be processed in place.
array$errorsList of errors in state machine definition. Errors may be specified in the diagram as well.
Returns
bool True when machine is successfully loaded, false otherwise.

Implements IMachineDefinitionReader.

◆ inferStateMachine()

inferStateMachine ( Graph  $graph,
string  $state_machine_participant_id,
string  $state_machine_process_id 
)
protected
See also
Node[] $receiving_nodes
Edge[] $visited_arrows
Node[] $visited_nodes
Node[] $active_receiving_nodes
Node $node
Node $rcv_node
Node $node
Node $receiving_node
Node[] $next_invoking_nodes
Node $invoking_node
Node $s_target
Node $t_target

◆ renderBpmn()

renderBpmn (   $prefix,
  $fragment_file,
  $fragment,
  $errors 
)
protected
See also
Graph $graph
Node $n

◆ renderBpmnJson()

renderBpmnJson ( array &  $machine_def,
  $prefix,
  $fragment_file,
  $fragment,
  $errors 
)
protected
See also
Graph $graph
Node $n