Workflow Variables and Functions
Variables
Variables in a workflow are enclosed by curly braces and prefixed by a dollar sign: ${variable_name}
.
Variable name | Description |
---|---|
job_id |
Returns the ID of the current job |
job_title |
Returns the title of the current job |
current_user_name |
Returns the first and last name of the current user (e.g. "John Doe") |
current_user_email |
Returns the email address of the current user (e.g. "john@acme.com") |
previous_user_name |
Returns the first and last name of the previous job user (e.g. "John Doe") |
previous_user_email |
Returns the email address of the previous job user (e.g. "john@acme.com") |
previous_job_title |
Returns the title of the previous job |
origin_job_user_name |
Returns the first and last name of the origin job user (e.g. "John Doe") |
origin_job_user_email |
Returns the email address of the origin job user (e.g. "john@acme.com") |
origin_job_title |
Returns the title of the origin job |
current_weekday |
Returns the current weekday as a localized string (e.g. "Thursday") |
current_date |
Returns the current date in a localized format (e.g. 6/20/19) |
Job Sequences
Jobs in a sequence can be addressed as follows:
Metadata Keys
Key | Description |
---|---|
{"disabled" : true} |
Disables the possibility to edit a workflow element during the job (currently only available for number elements and business object selection elements). |
{"showInRadarChart" : true} |
enables to show a radar chart for 5s workflows (has to be in every 5S group) |
{"defaultValues" : {"ELEMENT_ID": "DEFAULT_VALUE"}} |
For nested workflow element only, sets default values for elements in the nested workflow |
{"minValue" : ${ELEMENT_ID}} |
For number element only, adds validation for minimum value which can be other number, calculation or Business Object element |
{"maxValue" : ${ELEMENT_ID}} |
For number element only, adds validation for maximum value which can be other number, nalculation or Business Object element |
{"calculatedValue": ${ELEMENT_ID}+${ELEMENT_ID}+${ELEMENT_ID}} |
Show the input from other text fields within an other text field |
Element references
All elements in a workflow can be referenced by variables. Use the action in the workflow designer to copy the appropriate variable string to the clipboard (${id-of-copied-object-selection-element-link. e.g. ${d8378c86-49fc-bd7a-1d45-0c7dd5aa43d1}
).
If the referenced element is a business object selection, you can also reference particular properties of the object by the respective property ID. We call this
deep referencing: ${id-of-copied-object-selection-element-link.properties
.id-of-model-designer-property-element-link} (e.g. ${d8378c86-49fc-bd7a-1d45-0c7dd5aa43d1.properties.c6e4039d-0785-4795-a4db-03159700d944}
).
Functions
math()
The math()
function can be used to evaluate mathematical expressions. An example of a mathematical expression would be math(1+1)
. This would return 2
as a result. The math()
function can also be combined with variables: math(${var1}\*${var2})
.
Decimal values need to use .
as the decimal separator (e.g. math(2\*2.5)
).
days_between()
(Beta)
The days_between()
function can be used to calculate the number of days between two given dates. The result is always an absolute value. The function expects two dates in YYYY-MM-DD
format separated by a comma like days_between(2020-01-01,2020-01-15)
.
Variables can also be used as function parameters like this: days_between(${current_date},${d8378c86-49fc-bd7a-1d45-0c7dd5aa43d1})
.