Shared Variables

AutoMate variables play an important role in the creation of intelligent, nimble automated processes because they enable developers to add flexibility to a task. Rather than entering data directly into a task, a developer can use variables as a means to provide temporary storage for dynamic data in which to call upon during execution of the task. This makes it possible for the same task to process different sets of data each time it executes.

In AutoMate BPA Server, variables take on a much larger role because they have the ability to become “Shared Variables”. Shared variables are essentially variables that are accessible throughout an entire workflow. They are identical to normal variables in that their value can be interpreted, set or changed during task execution. But unlike normal variables that are created and shared within a single task, the value of a shared variable can be read by other workflow objects or its contents modified by other tasks that reside in the same workflow. Once a Shared Variable is created, its contents can be called upon by other workflow objects (i.e. tasks, evaluation objects, etc.) at runtime by enclosing the variable name with percentage (%) signs.

Shared variables are declared at the workflow level. This informs the workflow that the contents of the variable can be shared between all objects in the workflow. For example, a workflow’s path includes several tasks which are named Task1, Task2, Task3 and Task4. If a variable created in Task1 running on Agent A, is declared by the workflow as a shared variable, (by entering the variable name in the Shared Variables tab), that variable and its value can be accessed and/or modified by Task2, 3 or 4 running on any Agent as long as those tasks are executed within the same workflow.

Adding a Shared Variable to a Workflow

In order for a variable to be declared as a shared variable, it must be added to the Shared Variables tab of the Workflow Designer. Follow the instructions below to accomplish this:

  1. From the Workflow Designer, select the Shared Variables tab.

  2. Right click anywhere inside the Shared Variables section. This will display a pop-up menu. Select the Add Variable option as shown below, circled in red.

  1. A dialog titled Workflow Variable appears as shown below. Enter any specific data contained in the General and Advanced tabs.

  2. Click Ok to save the settings and close the properties dialog.

 

Parameters

Shared Variables are used as a storage mechanism to store and share data during the execution of a workflow. The Workflow Variable dialog described above is used to enter the name of the shared variable, its initial value (if required) and other parameters that dictate its behavior. The available parameters are described below.

General Tab

Name

Specifies the name of the variable that should be shared throughout the workflow.

Initial value

Specifies the value that the variable should be set to initially. As with all parameters, this value may be literal or an expression (if surrounded by percent % signs).

Description

An optional text description that describes the purpose of the shared variable.

Workflow Variable Dialog

Advanced Tab

Variable Type

Causes the variable to assume a specific type.

The available options are:

Treat as Parameter

If enabled, the value of the shared variable that resides in the parent workflow is allowed to be passed to any embedded workflow (or sub-workflow). If disabled, the value of the shared variable is only available to the parent workflow.

Variable is private

If enabled, the value of a shared variable encompassed in the embedded workflow does not propagate back to the parent workflow upon the embedded workflow’s completion. If this value is disabled, the specified shared variable’s value will be available to the parent workflow.

Notes

 

See Also

About Variables

Workflow Designer

Multi-machine Workflows