Variables¶
Variables are values managed by the BPM Engine, which are specific to a given case.
Variables can be set by Smartmate, by user tasks, or by service tasks.
Variables set by Smartmate¶
When a process is initiated, the following variables are automatically populated:
initiator
: References the initiator user.
Also, the following dynamic variables are set when needed:
now
: References the current date and time.
Variables set by user tasks¶
When defining a user task, you can save the user that is assigned to the task as a variable. This is useful for assigning the same user further tasks of the same case, as described in the user tasks documentation.
Variables set by service tasks¶
Service tasks can also be configured to set variables on specific steps.
For example:
The Generate Document Task can save its output into a variable.
The Data Setter or the HTTP Request service tasks can set the value of a new or existing variable, using the
mapping
property.
When a variable is set, it can then be used in further steps of the process.
Access variables from templates and process YAML files¶
To access variables from templates or process YAML files, you must use the _vars
prefix.
For example, to get the initiator user, you should use _vars.initiator
.
You can use this variable in your process YAML file, or in any template:
summary:
title: "Case initiated by {{_vars.initiator.firstName}}"