Skip to content
Nayra is a BPMN workflow engine in PHP. Utilize it in your own projects to have your own complex workflow capabilities.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
src/ProcessMaker/Nayra Open message flow to any source or target type Sep 3, 2019
LICENSE Initial commit Mar 20, 2018
composer.json Set license of the package to Apache-2.0 Oct 9, 2018
phpunit.xml Initial commit of classes. Mar 21, 2018

ProcessMaker Nayra

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();

ParallelGateway diagram

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 Event

Execute tokens and run to the next state


One token arrives to the first task

        $firstTask = $bpmnRepository->getScriptTask('start');
        $token = $firstTask->getTokens($instance)->item(0);

First task

Complete the first task


Execute tokens and run to the next state


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);

Second task and third task


ProcessMaker Nayra is open-sourced software licensed under the Apache 2.0 license.

You can’t perform that action at this time.