PHP code example of bingo-soft / bpmn
1. Go to this page and download the library: Download bingo-soft/bpmn library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
bingo-soft / bpmn example snippets
//create new invoice business process
Bpmn::createProcess()
->executable()
->startEvent()
->name("Invoice received")
->formKey("embedded:app:forms/start-form.html")
->userTask()
->name("Assign Approver")
->formKey("embedded:app:forms/assign-approver.html")
->assignee("demo")
->userTask("approveInvoice")
->name("Approve Invoice")
->formKey("embedded:app:forms/approve-invoice.html")
->assignee('${approver}')
->exclusiveGateway()
->name("Invoice approved?")
->gatewayDirection("Diverging")
->condition("yes", '${approved}')
->userTask()
->name("Prepare Bank Transfer")
->formKey("embedded:app:forms/prepare-bank-transfer.html")
->candidateGroups("accounting")
->serviceTask()
->name("Archive Invoice")
->setClass("org.test.bpm.example.invoice.service.ArchiveInvoiceService")
->endEvent()
->name("Invoice processed")
->moveToLastGateway()
->condition("no", '${!approved}')
->userTask()
->name("Review Invoice")
->formKey("embedded:app:forms/review-invoice.html" )
->assignee("demo")
->exclusiveGateway()
->name("Review successful?")
->gatewayDirection("Diverging")
->condition("no", '${!clarified}')
->endEvent()
->name("Invoice not processed")
->moveToLastGateway()
->condition("yes", '${clarified}')
->connectTo("approveInvoice")
->done();