Workflow Instance Variables

Therefore™ supports the use of instance variables as a method to store information related to a specific workflow task and then making that available in a later task. This avoids having to create hidden index data fields in the workflow's category solely for the purpose of having specific data persist between workflow tasks.

Workflow instance variables exist independently from document index data and are declared directly within the workflow process definition. These variables can then be accessed by:

  • Workflow scripting

  • Workflow conditions

  • Assignments and macros

Workflow instance variables can be modified throughout a workflow instance via scripting and carry that modified value to the next task. The variable's value will then always be set to the default value at the start of a new workflow instance.

Configuration

Workflow instance variables can be configured in the 'Variables' tab of the workflow properties dialog. In this tab, administrators can define which variables should be available per instance. The current instance variables can be seen in a table with three columns.

Name
The name of the variable. This follows the same requirements as other system IDs (only Latin characters, digits and underscores). Variable names must be unique within the workflow process and are not case-sensitive when comparing names. When calling a variable by its name though, this must be done with correct casing.

Type
One of the following options that can be selected in a drop-down: Text (Unicode text up to 3000 characters), Integer (32 bit unsigned), Decimal, Date and Timestamp (always in UTC).

Default Value
This is the value the variable will assume at the beginning of each workflow instance. The variable's value can be changed throughout the instance with scripting, however, for any new instance, the variable will always assume the default value at the start. A variable cannot be set without being given a default value.

Scripting

Variable values can be used in workflow scripts via the following scripting functions:

GetInstanceVariableName (name)
Calls the instance variable under the specified name and uses its respective value.

SetInstanceVariable (name, value)
Sets the named variable to the specified value.

Note:

Calling a non existing variable in a workflow can cause the workflow to stop in an error.