Process Instance Variables
One of the most important mechanisms in process automation is the use of process instance variables, also called attributes. This mechanism makes automation flexible and able to connect to other devices by web services or handle form data.
Process instance variables consist out of a unique name and a value.
Variable Name
A variable name is a single word which starts with an alphanumeric Latin character (A-Z or a-z). It may contain the Latin letters A-Z or a-z and the digits 0-9. Other characters are not allowed.
Valid variable names are
-
MyVar
-
V1
-
X
Invalid variable names are
-
My Var
-
My_Var
-
0X
Variable Value
The value of a variable may contain the following types of values:
-
Integer
-
Float / Double
-
String
-
DateTime
-
Guid
-
List<Object>
-
Dictionary<String,Object>
Other types may work but must be serializable to store them in the global scope. The Objects in the List and Dictionary type may be out of these types too.
Global Scope
The global scope specifies all process instance variables, which may be accessed by an operation. Each operation must specify, if and how variables out of the global scope are used or not. The following modes are available:
- None
-
The variable is not used
- Import
-
The variable is made available in the operation but modifications of the variable value are not written back to the global scope.
- Export
-
The global scope will create or update the variable value at the end of the operation.
- Import + Export
-
The variable is made available in the operation and modifications are written back to the global scope at the end of the operation
The scope of each operation for the required variables may be edited in the Advanced Properties Window.
There are also a number of predefined variables which are described here.
Best Practice
Depending on the purpose of variables in workflows their usage and availability during the life time of a process instance differ.
- Global Scope
-
Variables with a global scope can be accessed in every state of a process instance. This results in a demand of performance. To avoid time delays and performance issues only those variables should have a global focus that are required during the whole life span of a process instance like form variables or atleast in many operations.
- Local Scope
-
Those variables are generated in expressions of tasks they are used in. Especially operations with high mounds of data are supposed to be used with local scope. Common examples are content of data grids and displayed values of drop down lists with workflow attributes as source. Furthermore results of database queries are supposed to be handled this way via schema diagram and query editor.