Skip to main content

Introduction

Back end expressions are a tool to get or set variables during the execution of processes, cases, or decision tables. Back end expressions can also be used to implement custom logic or to delegate that logic to a Java service deployed on the server. Examples of using expressions usage are setting dynamic task names, evaluation of sequence flows after a gateway, or create a variable of a certain type. As the name implies, these expressions run on the back end, during execution. As such they have no access to the frontend data at the time of evaluation.

In Flowable Design, expressions are allowed in fields marked with a lightning bolt: 500 bolt.

Flowable uses the Unified Expression Language (UEL) for resolving expressions. The documentation for UEL is a good reference for syntax and available operators. Each expression starts with ${ and ends with }.

There are two types of expressions:

  • value expressions provide a value. Supported values include Boolean, string, integer, floating-point number, and null. A typical value expression is ${variable.property} or ${bean.property}.

  • method expressions invoke a method with or without parameters. An example of method expression is ${bean.setPropertyValue('newValue')}. To distinguish between a value expression and a method expression without any parameters, use empty parentheses at the end of the method call. For example, ${variable.toString()}.

In theory, any Spring bean exposed to the application is available for use in backend expression, but not all classes can be serialized in a way which will allow for a proper expression evaluation.

info

Certain expressions are available in scripts (e.g. for use in a BPMN or CMMN script task). A list of expressions which can be used is available as part of the backend scripting documentation.

Keywords

The process and CMMN engines support context-dependent objects. Both engines resolve hierarchy objects like root and parent and can be used to access their local properties. root stands for the object on the top of the execution hierarchy, which can be a process instance or case instance. parent is a reference to the first process or case instance immediately above the current object in the hierarchy.

For process instances and case instances definition grants access to the definition and all its attributes.

In the context of BPMN execution, additional reserved keywords are execution and authenticatedUserId.

  • execution references to the current 'path of execution' or 'token'. It provides access to properties like name, businessKey, processDefinitionId, and parentExecution (technically, it is backed by the ExecutionEntity class).

  • task is a reference to the current task (technically, it is backed by the TaskEntity class).

  • authenticatedUserId is a string identifier of the currently authenticated user. If there is no authenticated user, the variable is not available.

The CMMN engine context supports task (see above), caseInstance, and planItemInstance.

  • caseInstance references to the current case instances. It provides access to properties like name, state, businessKey, caseDefinitionId, and parentId (technically, it is backed by the CaseInstanceEntity class).

  • planItemInstance references the plan item instance associated with the case.

When a process or case instance is deployed within a Flowable app, the flowApp keyword is available in both BPMN and CMMN contexts.

  • flowApp provides access to app-level variables (e.g. ${flowApp.customerName}) and to the app definition via ${flowApp.definition} (e.g. ${flowApp.definition.key}). See App Expressions for more details.

Reserved Variable Names

Flowable reserves a number of names at the task, process, case, and expression layers. Using any of these as a custom variable name can lead to unexpected results. The lists below are a non-exhaustive set of names to avoid when defining custom variables.

info

For form related list of reserved words see the Form Editor reference — Binding.

Task Properties

VariableTask property
idTask ID
nameTask name
descriptionTask description
stateTask state
ownerTask owner
assigneeCurrent task assignee
delegationStateTask delegation state (PENDING / RESOLVED)
priorityTask priority
categoryOptional tag classifying the task
formKeyForm reference for the task
dueDateTask due date
suspendedWhether the task is suspended
createTimeTask creation time
startTimeTask start time
endTimeTask end time
claimTimeTime the task was claimed
claimedByUser who claimed the task
completedByUser who completed the task
inProgressStartTimeDate/time when the task was put in progress
inProgressStartedByUser who put the task in progress
inProgressStartDueDateDue date while the task is in progress
parentTaskIdParent task ID for sub-tasks
parentTaskNameParent task name
executionIdExecution ID owning the task
processInstanceIdProcess instance ID
processInstanceNameProcess instance name
processDefinitionIdProcess definition ID
processDefinitionNameProcess definition name
processDefinitionCategoryProcess definition category
caseInstanceNameCase instance name
caseDefinitionNameCase definition name
caseDefinitionCategoryCase definition category
taskDefinitionIdTask definition ID
taskDefinitionKeyID of the activity in the process defining this task
scopeIdScope ID
subScopeIdSub-scope ID
scopeTypeScope type (bpmn, cmmn, etc.)
scopeDefinitionIdScope definition ID
tenantIdTenant ID
permissionsPermissions for the current user
translationsTranslation values

Process Instance Properties

VariableDescription
idExecution ID
processInstanceIdProcess instance ID
nameProcess instance name
businessKeyProcess business key
businessStatusBusiness status
businessStatusLabelTranslated business status label
suspendedWhether the process instance is suspended
suspensionStateSuspension state
isActiveWhether the execution is currently active
endedWhether the process instance has ended
completedWhether the process instance has completed
activityIdCurrent activity ID
startActivityIdStarting activity ID
startTimeProcess start time
endTimeProcess end time
startUserIdUser who started the process
assigneeProcess assignee
ownerProcess owner
dueDateProcess due date
claimTimeTime the process was claimed
claimedByUser who claimed the process
callbackIdCallback ID
callbackTypeCallback type
referenceIdReference ID
referenceTypeReference type
parentIdParent execution ID
superExecutionIdSuper execution ID for call activities
rootProcessInstanceIdRoot process instance ID
propagatedStageInstanceIdCMMN parent stage instance ID for executions inside a case stage
processDefinitionIdProcess definition ID
processDefinitionKeyProcess definition key
processDefinitionNameProcess definition name
processDefinitionDescriptionProcess definition description
processDefinitionCategoryProcess definition category
processDefinitionVersionProcess definition version
processDefinitionDeploymentIdProcess definition deployment ID
deploymentIdDeployment ID
tenantIdTenant ID
permissionsPermissions for the current user
translationsTranslation values

Case Instance Properties

VariableDescription
idCase instance ID
nameCase instance name
businessKeyCase business key
businessStatusBusiness status
businessStatusLabelTranslated business status label
parentIdParent case instance ID
stateCase instance state
completedWhether the case has completed
completeableWhether the case can complete
startedTime the case started
startTimeCase start time
endedTime the case ended
startUserIdUser who started the case
startedByUserIdUser who started the case
lastReactivationTimeLast time the case was reactivated
lastReactivationUserIdUser who last reactivated the case
assigneeCase assignee
ownerCase owner
dueDateCase due date
claimTimeTime the case was claimed
claimedByUser who claimed the case
customViewKeyCustom view key
agentInstanceIdAgent instance ID
callbackIdCallback ID
callbackTypeCallback type
referenceIdReference ID
referenceTypeReference type
caseDefinitionIdCase definition ID
caseDefinitionKeyCase definition key
caseDefinitionNameCase definition name
caseDefinitionDescriptionCase definition description
caseDefinitionCategoryCase definition category
caseDefinitionVersionCase definition version
caseDefinitionDeploymentIdCase definition deployment ID
tenantIdTenant ID
permissionsPermissions for the current user
translationsTranslation values

Multi-Instance Loop Variables

A BPMN multi-instance activity automatically sets the following variables.

VariableDescription
nrOfInstancesTotal number of instances in the loop, set on the multi-instance root execution
nrOfActiveInstancesNumber of currently active instances, set on the multi-instance root execution
nrOfCompletedInstancesNumber of completed instances, set on the multi-instance root execution
loopCounterIndex of the current iteration, set as a local variable on each child execution

The default loopCounter name can be overridden per activity via the elementIndexVariable attribute on the multi-instance loop characteristics.

Reserved Internal Prefixes

Flowable reserves variable names starting with __flowable or __flw for engine-internal use, and may add further internal names under these prefixes in future releases without notice.