Gateways
Licenses | ENTERPRISE, CORPORATE |
Since | VERSION 7.0 |
Introduction
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 the most important operators are:
Arithmetic:Ā
+
,Ā-
Ā (binary),Ā*
,Ā/
Ā andĀdiv
,Ā%
Ā andĀmod
,Ā-
Ā (unary)Logical:Ā
and
,Ā&&
,Āor
,Ā||
,Ānot
,Ā!
Relational:Ā
==
,Āeq
,Ā!=
,Āne
,Ā<
,Ālt
,Ā>
,Āgt
,Ā<=
,Āge
,Ā>=
,Āle
. Comparisons can be made against other values, or against boolean, string, integer, or floating point literals.Empty: TheĀ
empty
Ā operator is a prefix operation that can be used to determine whether a value isĀnull
Ā or empty.Conditional:Ā
A ? B : C
. EvaluateĀB
Ā orĀC
, depending on the result of the evaluation ofĀA
.
For more details see Unified Expression Language - The Java EE 5 Tutorial
Ā
Examples of gateway conditions
Condition for dropdown
Condition refers to a field named ādecisionā
Field provides a dropdown list for user (Approve, Decline, 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 also. Similar ${ !checked } can be use 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 user (Approve, Decline, 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:
Ā