AutoMate BPA Server Enhanced Data Sharing

by Marjo Martinez, in Tech Talk, posted 3/16/10

Introduction

AutoMate’s implementation of variables, arrays and datasets play an important role in the construction of intelligent, flexible and nimble automated processes because they enable a means to store and share dynamic values for use in any task step as well as associated sub-tasks. Once created, these objects can be used in any action’s properties that allow input of expressions by simply placing the object name between percent signs (%). This makes it possible for the same task to process different sets of data each time it executes.

In AutoMate BPA Server, variables, datasets and arrays take on a much greater role given that they have the ability to become “shared”. This essentially means that information can be accessible in any step of a workflow. Having the ability to store and retrieve shared data during workflow execution greatly increases its functionality and usefulness.

This article will provide details regarding the use of variables, arrays and datasets in AutoMate BPA Server. It will supply proper instructions on how to create and configure shared objects and how to access them during workflow execution. It will also present some important information in regards to specific parameters, functionality and execution behavior of shared objects.

Configuration

Shared variables, arrays and datasets are declared at the workflow level during design time. The Output/Shared Objects pane of the Workflow Designer (bottom right corner) is specifically designed to provide a suitable location to create and configure these objects. Upon creation, the workflow is informed that the contents of the specific object can be shared between all objects residing in the workflow during workflow execution.

Shared Variables

Shared Variables (also known as workflow variables) are used as a storage mechanism to store and share data during the execution of a workflow.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 actions contained in other tasks that reside in the same workflow. Once a shared variable is created, its contents can be called upon at runtime by enclosing the variable name with percentage (%) signs.

For example, a workflow’s path includes several tasks assigned to different agents. Tasks are named Task1, Task2, Task3 and Task4. If a variable set 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 steps residing in the current task as well as Task2, Task3 or Task 4 running on any agent as long as those tasks are executed within the same workflow.

To create & configure a shared variable:

  1. From the Workflow Designer, select the Shared Variables tab.
  2. Right click anywhere inside the Shared Variables section and select the Add Variable option from the popup menu that appears.

  3. A dialog titled Workflow Variable appears as shown below. This dialog is used to enter the name of the shared variable, its initial value (if required) and other parameters that dictate its behavior.

  4. Enter any specific data contained in the General and Advanced tabs
  5. Click Ok to save the settings and close the Workflow Variable properties dialog.
  6. The information entered below outlines specific parameters in regards to workflow variables.
    General Tab Parameters
    Name - Denotes the name of the shared variable to be created. It is important that this value is unique, descriptive and does not conflict with any BASIC scripting keywords.
    Initial Value - Specifies the initial value that the shared variable should be populated with. As with all parameters, this value may be literal or an expression (if surrounded by percent signs).
    Description - An optional text description that gives important details about the purpose of the shared variable.
    Advanced Tab Parameters
    Variable Type - Causes the variable to assume a specific type. The available options are:
    Auto: The variable will auto-detect whether it is populated with a number or text. The variable will adapt to the proper type when possible depending on the operation being performed.
    Text: The variable will always be treated as text (by default) regardless of its contents. If an operation is attempted that is only valid for numbers, an error will be generated.
    Number: The variable will always be treated as a number regardless of its contents. If an operation is attempted that is only valid for numbers, an error will be thrown.
    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.

IMPORTANT NOTES:

  • If a shared variable is created and configured within the workflow level, it no longer needs to be created in the task level using the Create Variable action.
  • To ensure that shared variables can be passed between the parent and embedded workflow and vice versa, make sure to enable the Treat as Parameter option and disable the Variable is Private option.
  • Only shared variables with the same name are passed between parent and embedded workflows and vice versa (when the settings permit).
  • Remember not to use percent signs when specifying the name of a variable to populate. Percent signs are only needed to get data "out". For example, if an Evaluation Object is used to determine the value of a variable named myVar, simply enter myVar in the properties of the Evaluation Object.

To add a shared array to a workflow:

  1. From the Workflow Designer, select the Shared Arrays tab.
  2. Right click anywhere inside the Shared Arrays section and choose Add Array from the popup menu that appears (as shown below).

  3. A dialog titled Workflow Array appears as shown below.

  4. On the General tab parameters, enter the following information:
    Name - Specifies the name of the array that should be shared throughout the workflow.
    Description - An optional text description that describes the purpose of the shared array.
  5. After entering the proper information, click OK to save changes and exit the properties dialog.

Shared Datasets

Unlike normal datasets that are created and shared within a single task, the value of a shared dataset can be read by other objects or tasks that reside in the same workflow. For example, if a dataset created in Task A running on Agent Ais declared by the workflow as a shared dataset, the values of that dataset can be called upon by any step of any task included in the workflow.

To add a shared dataset to a workflow:

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

  2. Right click anywhere inside the Shared Datasets section and select Add Dataset from the popup menu, as shown below.
  3. On the General tab, enter the following information:
    Name - Specifies the name of the dataset that should be shared throughout the workflow.
    Description - An optional text description that describes the purpose of the shared dataset.
  4. After entering the proper information, click OK to save changes and exit the properties dialog.