processmaker / nayra
BPMN compliant engine
Installs: 68 596
Dependents: 3
Suggesters: 0
Security: 0
Stars: 123
Watchers: 33
Forks: 32
Open Issues: 19
Requires (Dev)
- phpunit/phpunit: ^9.5
- dev-release-2024-fall
- dev-develop
- 1.12.0
- 1.11.1
- 1.11.0
- 1.10.0
- 1.9.8
- 1.9.7
- 1.9.6
- 1.9.5
- 1.9.4
- 1.9.3
- 1.9.2
- 1.9.1
- 1.9.0
- 1.8.0.x-dev
- 1.8.0-RC1
- 1.7.1
- 1.7.0
- 1.7.0-RC5
- 1.7.0-RC4
- 1.7.0-RC3
- 1.7.0-RC2
- 1.7.0-RC1
- 1.6.0
- 1.5.0
- 1.4.1
- 1.4.0
- 1.3.1
- 1.3.0
- 1.2.0
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- dev-next
- dev-release-2024-summer
- dev-bkp-next
- dev-FOUR-16341
- dev-next-rb
- dev-release-2024-spring
- dev-FOUR-15486
- dev-FOUR-11120
- dev-boundary-message
- dev-bugfix/FOUR-11368
- dev-main
- dev-bugfix/FOUR-10728
- dev-feature/FOUR-8066
- dev-bugfix/FOUR-10219
- dev-bugfix/FOUR-6610
- dev-bugfix/FOUR-6636
- dev-feature/FOUR-6588
- dev-bugfix/FOUR-5882
- dev-bugfix/FOUR-5882a
- dev-4.1-develop
- dev-bugfix/FOUR-4917-4.1
- dev-bugfix/FOUR-4923
- dev-bugfix/FOUR-4407
- dev-bugfix/tickets-1075
- dev-bugfix/FOUR-4086
- dev-v1.7.0-RC3
- dev-v1.7.0-RC2
- dev-bugfix/loop_standard
- dev-v1.7.0-RC1
- dev-bugfix/FOUR-3538
- dev-ticket-697
- dev-feature/ticket-695
- dev-bugfix/FOUR-3323a
- dev-bugfix/FOUR-3599
- dev-bugfix/add_missing_param_patters_tests
- dev-bugfix/FOUR-3323
- dev-upgrade/phpunit_7
- dev-feature/empty_input_collection
- dev-testing/add_mi_data_tests
- dev-bugfix/trigger_conditional_default_transition_event
- dev-feature/multiinstance
- dev-webhooks
- dev-feature/signal-payload
- dev-accept-null-engine-on-load
- dev-184-fix-task-with-two-or-more-outgoing-flows
- dev-feature/168
- dev-feature/179
- dev-feature/173B
- dev-177-add-bpmn-element-reference
- dev-174-implement-collection-findfirst
- dev-feature/173
- dev-feature/169
- dev-feature/165
- dev-feature/163
- dev-feature/161
- dev-feature/155
- dev-bugfix/156
- dev-feature/153
- dev-feature/151
- dev-feature/131
- dev-feature/146
- dev-feature/142
- dev-feature/144
- dev-feature/138
- dev-feature/136
- dev-feature/134
- dev-feature/132
- dev-bugfix/127
- dev-feature/125
- dev-feature/120
- dev-feature/115
- dev-feature/113
- dev-feature/111
- dev-feature/109
- dev-feature/107
- dev-feature/104
- dev-feature/102
- dev-feature/100
- dev-feature/98
- dev-feature/96
- dev-feature/94
- dev-feature/92
- dev-feature/90
- dev-feature/85
- dev-feature/80
- dev-feature/87
- dev-feature/83
- dev-feature/81
- dev-feature/77
- dev-feature/57
- dev-feature/71
- dev-feature/72
- dev-feature/67
- dev-feature/66
- dev-feature/65
- dev-feature/63
- dev-feature/52
- dev-feture/53
- dev-feature/26
- dev-feature/25
- dev-feature/31
- dev-feature/29
- dev-feature/32
- dev-feature/30
- dev-feature/28
- dev-feature/27
- dev-feature/44
- dev-feature/41
- dev-feature/39
- dev-feature/38
- dev-feature/24
- dev-feature/19
- dev-feature/34
- dev-feature/14
- dev-feature/20
- dev-feature/18
- dev-feature/12
- dev-feature/7
- dev-feature/9
- dev-feature/8
- dev-feature/BPM-9
- dev-feature/5
- dev-feature/BPM-12
This package is auto-updated.
Last update: 2024-11-08 09:49:56 UTC
README
ProcessMaker Nayra is a package that provides base classes to implement a process execution engine. This includes patterns to implement activities, events and gateways.
How to execute a process
Load a BPMN definition
$bpmnRepository = new BpmnDocument();
$bpmnRepository->setEngine($this->engine);
$bpmnRepository->setFactory($this->repository);
$bpmnRepository->load('files/ParallelGateway.bpmn');
Get a reference to the process
$process = $bpmnRepository->getProcess('ParallelGateway');
Create a data storage
$dataStore = $this->repository->createDataStore();
Create a process instance
$instance = $this->engine->createExecutionInstance($process, $dataStore);
Trigger the start event
$start = $bpmnRepository->getStartEvent('StartEvent');
$start->start($instance);
Execute tokens and run to the next state
$this->engine->runToNextState();
One token arrives to the first task
$firstTask = $bpmnRepository->getScriptTask('start');
$token = $firstTask->getTokens($instance)->item(0);
Complete the first task
$startActivity->complete($token);
Execute tokens and run to the next state
$this->engine->runToNextState();
One token arrives to the second task and one to the third task
$secondTask = $bpmnRepository->getScriptTask('ScriptTask_1');
$token1 = $secondTask->getTokens($instance)->item(0);
$thirdTask = $bpmnRepository->getScriptTask('ScriptTask_2');
$token2 = $thirdTask->getTokens($instance)->item(0);
License
ProcessMaker Nayra is open-sourced software licensed under the Apache 2.0 license.