/
Gateways

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:

  1. To define the rule for the decline gateway, select the declined edge of the gateway and fill-in this condition: ${vacationApproved == false}:

  2. This makes sure that this branch is executed in case the supervisor set vacationApproved to false in the task form.

  3. Repeat these steps for the task ā€œSend approved emailā€ and set the condition to
    ${vacationApproved == true}.

  4. 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:

Ā 

Related content