...
Table of Contents | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
What is a BPMN Workflow?
BPMN (Business Process Model and Notation) is a worldwide ISO standardisation to describe business processes in a formalized (graphical) way so it can be discussed and is interchangeable between business and technical teams and also across departments and companies.
...
If you’re not familiar with the BPMN concept so far, we highly recommend you to learn the basics before you dive deeper into this chapter. Here you can find a first introduction on Wikipedia: https://en.wikipedia.org/wiki/Business_Process_Model_and_Notation .
Modelling a BPMN Workflow
Below is a very simple example of a BPMN diagram, which shows a vacation approval process where the employee must fill-out a request form, and the supervisor can then approve or decline the vacation request:
...
Lets shortly explain those basic items below.
Start Item
...
This is the starting point of a BPMN workflow and defines how the workflow will be started. This can be done manually or triggered by an event for example. If nothing is defined, it is always considered to be started manually.
User Task
...
The user task is the part of a workflow in case manual input from a user is required. For example to review some data and approve it. This input is typically requested using a form showing one or more form fields to the user he then can fill out.
Form
The workflow waits at this user task until the user has filled-out the form and finished this task by clicking the COMPLETE button of the form. In PIPEFORCE such a form can be defined in the online modeller using the FORM tab.
...
Simple = The form fields can be directly defined in the tab and will be displayed vertically one after another. This is the simplest approach but is limited. So for example you can not change the orientation of the fields, no special fields are supported, fields are limited to max. 4000 chars and validation is also quite limited.
Custom = These are advanced forms where you have full flexibility of the PIPEFORCE form framework to design your user task form. With this flexibility also a bit more complexity comes. See here for documentation about the form framework: Forms Framework.
Assignment
User tasks can be assigned in the workflow to specific users and user groups, by using the GENERAL tab. This can be done in the Assignment section:
Assignee is a single username. If defined, the user task will be automatically assigned to the user with this username when created.
The Candidate Users field define the users allowed to pick and claim this task. They will see the task instance of example in the TODO filter which can be seen as a “task pool”. Same is true if user is member in one of the groups mentioned in the Candidate Groups field. Multiple entries in these fields must be separated by comma.
...
Service Task
...
If a task in the BPMN workflow must be executed in by an automated way by a service (“machine”), it must be marked as a service task. Such automated steps could be for example sending an email, doing a data conversion, connecting to external systems and a lot moreor much more complex steps. Here full automation is possible.
By default, such a service task is linked to a data pipeline which defines all the these “instructions” to the machines “machines” (services) to be executed in an automated way as soon as the workflow arrives at this service task.
You can link the a service task to the a data pipeline by selecting clicking the service task and then in the PIPELINE tab select a an already existing data pipeline you would like to execute when this service task is executedstarts. Or you create a new pipeline and link this one.
...
it there.
...
Decision Gateway
...
In case the flow direction inside a BPMN workflow must change depending on a condition, a decision gateway or just gateway in short can be used. For example if the user has approved a request in the form, this approval information can be used to decide to follow the approval path.
End Item
...
The end item (also known as end state) defines when the process must be finished. Typically a BPMN workflow must always have exactly one such end state. There are some rarely cases which could differ from that.
How to start a workflow in PIPEFORCE?
The design and execution of a workflow in PIPEFORCE is always a 3-steps task:
...
Then, you can login to your portal at https://<NAMESPACE>.pipeforce.net
, and complete the workflow.
How to create a trigger pipeline
A pipeline, executed when an app is started, is called a trigger pipeline. Each pipeline is written in YAML format.
...
Let's create a simple trigger pipeline:
1. Headers
The headers section is optional in our trigger pipeline. It is used to configure any global variable which is used to execute the pipeline e.g. description of the pipeline, auto execute pipelines, manage versions, user authorization, etc. Headers can be used in pipeline like following:
...
Note: To get more details regarding this feature, please see: Headers
2. Vars
This section is also optional in our trigger pipeline. This helps to initialize the variables and set those variables later in the other steps in the same pipeline.
Code Block |
---|
vars: workflowModelInstanceKey: null # To be set by the workflow when calling this pipeline workflowModel: "#{@property.lazy(vars.workflowModelInstanceKey)}" |
3. Pipeline
Pipeline section is mandatory for execution of any application. It includes all the commands which are executed in the sequential order. We use the Pipeline Expression Language (PEL) to write the expressions in pipeline. Scope of pipeline is defined as follows:
...
Give permissions for accessing files to a role or a group.
Code Block pipeline: - iam.run.as: username: "systemuser" - drive.share: to: "invoice-controller" type: "group" path: "global/app/accountspayable" permission: 1
Evaluate any expressions.
Code Block - eval: expr: "#{body.name = 'assignedvalue'}"
4. Workflow Model
Workflow model enables you to map your data from entry-form to your application workflow. It allows us to use the inputted data throughout the application. The workflow model can be defined as follows:
...
Note: To get more details regarding this feature please see: Workflow Model
5. Save Workflow Model Into Schema
It enables you to save the entry-form data into a schema. Schema is a file where we define all the fields that are there in entry-form with their data types. The file is in JSON format. e.g.
...
Note: To get more details regarding this feature, please see: property.schema.put
6. Start Workflow
In this section, we define those variables which we process and use them in the subsequent steps. We use workflow.start to start processing the fields from the entry-form and map them in key:value pair and then use later in different pipelines e.g.
...
vars.fname, vars.email, vars.account, vars.comment
BPMN Gateway
A gateway in BPMN is a branch of the workflow. Depending on a condition, the flow of the process can branch into different directions.
Where to define gateways conditions?
In this example, depending on whether the supervisor has approved or declined the vacation request, the workflow should execute the “Send declined email” or the “Send approved email” task. For this, we need to define rules on the gateway edges:
To define the rule for the decline gateway, select the declined edge of the gateway and fill-in this condition:
${vacationApproved == false}
:This makes sure that this branch is executed in case the supervisor set
vacationApproved
to false in the task form.Repeat these steps for the task “Send approved email”, and set the condition to
${vacationApproved == true}
.Click
SAVE
to save the current state of the BPMN workflow.
...
How to design gateways
The gateway design is defined by a specific expression language named JUEL. Below, you will find that the most important operators are:
...
For more details see https://docs.oracle.com/javaee/5/tutorial/doc/bnahq.html
Examples of gateway conditions
Condition for dropdown
Condition refers to a field named “decision”
Field provides a dropdown list for the user (Approve, Decline, or Delegate)
Gateway should represent the “Approve” selection
Condition looks like this:
...
Condition for checkbox
Condition refers to a field named “checked”
Field provides a checkbox
Gateway should represent the situation that the checkbox is ticked
Condition looks like this:
...
${ checked } works as well. Similarly, ${ !checked } can be used in place of ${ checked == false }
Condition for value
Condition refers to a field named “Kosten”
Field provides the option to type in numbers
Gateway should represent the situation that the value is > 100, but < 1000
Condition looks like this:
...
Multiple conditions
Condition refers to the fields: “decision” and “checked”
Field “decision” provides a dropdown list for the user (Approve, Decline, or Delegate)
Field “checked” provides a checkbox
Gateway should represent the situation that:
“Approved” is selected from dropdown
Tick is set for “checked”
Condition looks like this:
...
Workflow Variables
All values entered in a form are stored in variables and can be displayed & edited with subsequent task forms. In this section, you will learn how to display those variables.
Define form fields as workflow variables
In case, you are defining form fields via the Online Workflow Modeler, like in the example below, all field IDs are directly stored as workflow variables. If you use those IDs in multiple steps in the workflow model, the content entered in previous steps are displayed automatically.
In case, you would like to use workflow variables from a trigger form, there are a few additional steps to do. These steps are described in this tutorial Tutorial: Create a new BPMN workflow, section 9 & 10.
Display workflow variables
To display values entered during the workflow in subsequent (task) forms, you can just create a field with an identical ID in the Online Workflow Modeler (e.g. taxRate).
...
Make a variable read-only
As default, the values are editable. That means a user, who is assigned to this task, is able to see the entered value and overwrite it. To change it to “read-only”, you have to follow these steps:
...