Unify and manage your data

Overview of Workflow Task Variables

Learn about workflow task variables.

Every workflow task can have variables associated to the workflow process or to a specific step. These variables typically have information that can be used in custom workflows.

Workflow task variable types

Here are the supported variable types.
Table 1. Table 1: Variable Types
Type NameDescription
stringThe value of this variable is treated as a java.lang.String.
integerThe value of this variable is treated as a java.lang.Integer.
shortThe value of this variable is treated as a java.lang.Short.
longThe value of this variable is treated as a java.lang.Long.
doubleThe value of this variable is treated as a java.lang.Double.
booleanThe value of this variable is treated as a java.lang.Boolean.
dateThe value of this variable is treated as a java.util.Date.
binaryThis value is treated as an array of bytes. The value attribute is null, the valueUrl contains a URL pointing to the raw binary stream.
serializableSerialized representation of a Serializable Java-object. As with the binary type, the value attribute is null, the valueUrl contains a URL pointing to the raw binary stream. All serializable variables (which are not of any of the above types) will be exposed as a variable of this type.

For information on variable attributes and additional variable types see Activiti User Guide Rest Variables and Activiti User Guide API variables.

Getting workflow task variables

To get the variables associated with a workflow task use the Get Task Details API endpoint by specifying showTaskVariables or/and showTaskLocalVariables parameters:
  • showTaskVariables returns information about variables that belong to the complete workflow process, task variables.
  • showTaskLocalVariables returns variables associated with the current step of the Workflow task.

Searching tasks by variables

UI

In the UI, in your Inbox set Filters to search by generic fields like Task type, Step, DCR type, Entity type, Relationship type, Priority, Created by, Created date, Entity ID, DCR ID along with the filters that were saved as task variables:

API

Use the Workflow API endpoint to retrieve tasks, specifying the variables field in the payload as key and value pairs.

Out of the box (OOTB) task variables

The Workflow API sets the following variables for OOTB workflow tasks, with associated listeners:

  • entityType
    • Listener: com.reltio.workflow.activiti.service.EntityTypeTaskListener

  • relationType
    • Listener: com.reltio.workflow.activiti.service.RelationTypeTaskListener

  • dcrType
    • Listener: com.reltio.workflow.activiti.service.DCRTypeTaskListener

Note:

The com.reltio.workflow.activiti.service.DCRTypeTaskListener listener is applicable for DCR workflow processes and sets all variables for tasks (including entityType and relationType). So for DCR processes you don't need to add all listeners, adding the DCRTypeTaskListener is enough.

When a workflow task has many related entities/relationships, all values are joined with a comma (,). For example:

  • entityType=configuration/entityTypes/HCP,configuration/entityTypes/HCO

  • dcrType=CREATE_ENTITY,INSERT_ATTRIBUTE

Leverage these task listeners in your custom workflows by adding them to tasks using the Workflow Modeler in the console. For example:

Custom workflow task variables

To have other information about tasks stored in variables, like region information from a value of an attribute in the entity, you can write a task listener and set this information in a task. Here is an example from the Workflow project - DCRTypeTaskListener.java

All variables that are set there will be available for filtering in the Inbox application.

Important: Do not store secret information, such as username/password, into task variables.