Conditions
Conditions
BPMN elements can have a property attached to them which either executes a script or evaluates an expression in order to make a decision. The most common example of this is the Sequence Flow elements following an Exclusive Gateway. Each Sequence Flow element will have a condition attached to decide which flow should be pursued. The Camunda Modeler distinguishes the two types in the Type
attribute of the Condition
tab in a BPMN element. Camunda comes with a GraalVM JavaScript engine but can be extended with other types of scripting engines. See the Camunda documentation on scripting for more details. Expressions are short boolean evaluations and have the following syntax: ${expression}
. An example of a simple expression would be a condition like var = true
. For this to work during BPMN process execution, the variable that is used for the boolean condition must be available in the BPMN process variables before the Sequence Flow reaches the evaluation of the expression. You can learn more advanced features of Expressions here.