Process variables

A process variable is a value that Collibra stores with each workflow instance. You can retrieve and change that value each time the workflow runs.

Setting process variables

You can use the start form to create process variables, including configuration variables. The value you enter as the Initiator variable field in the Details section of the start form is also a process variable. This variable defines the user who starts the workflow.

In your user tasks, each data entry or selection component becomes a process variable. Use the component Value to reference the variables.

In your script tasks, you set a variable with the following line of code where <variable_name> is a String and <variable_value> is an object:

execution.setVariable(<variable_name>, <varaible_value>);

Retrieving process variables

In your script tasks, you retrieve a variable with the following line of code where <variable_name> is a String:

execution.getVariable(<variable_name>);

Outside script tasks, you can retrieve the value of a variable by including the variable name in an expression: {{}}, for example {{startUser}}.

Use the form ID to reference variables created by forms.

Exchanging process variables with a sub-process

Sub-processes are workflows that run as part of a parent workflow. They are not meant to be stand-alone workflows. You must provide values at least for the start form variables that have the Required property set to true. You may also want to use the values of some of the sub-process variables in the parent workflow. To exchange information between the parent workflow and the sub-process, configure the call activity in the parent workflow:

  • In the In section of the Details section, enter process variables from the parent workflow in the Source Variable column and the corresponding sub-process variables in the Target Variable column.

    Use an expression in the Source Expression column if you want to pass a hard-coded value to a sub-process variable, for example {{"Enter a brief description"}} or {{false}}.

  • In the Out section of the Details section, enter sub-process variables in the Source Variable column and the corresponding process variables from the parent workflow in the Target Variable column.

Since the parent workflow and the sub-process are separate workflows, you can use the same name for corresponding variables.