Shared Arrays

Like variables, arrays are used to represent data in a task that may be different each time a task runs. But unlike standard variables, arrays can contain multiple rows and optionally, multiple columns. In BPA Server, arrays have the ability to become "shared", which means they are accessible by any objects contained in a given workflow. Unlike normal arrays that are created and shared within a single task, shared arrays are created and declared at the workflow level. This informs the workflow that its contents can be read by other objects or modified by other tasks that reside in the workflow.

Once an array is created at the workflow level, it is declared a shared array, making it accessible by any object contained in that workflow as long as its name is enclosed with percentage signs (e.g., %arrayName%). Unlike a normal array, a shared array can be accessed within any task step without the need to first create it. In addition, a shared array can be passed from the parent workflow to a sub-workflow and vice versa.

Creating Shared Arrays

In order for an array to be declared as a shared array, it must be added to the Shared Arrays tab located in the Output/Shared Objects panel of the Workflow Designer.

To create a shared array:

  1. In the Workflow Designer, select the Arrays tab.

  2. Right click anywhere inside the Arrays panel to open the context menu.

  3. Select Add Array, as shown below.

  4. A dialog titled Array appears as shown below.

  5. Enter the required information then click OK to save and close.

Parameters

The Array dialog described above is used to enter required and optional parameters. The available parameters are described below.

General

Property

Description

Name

The name of the array that should be shared throughout the workflow.

Initial Value

An optional value that the array should be set to initially.

Description

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

Managing Shared Arrays

To delete a shared array:

  1. On the Arrays tab, right-click the array to delete. To select more than one array, hold down CTRL during selection.

  2. From the context menu that appears, select Delete Array (to delete a single array) or Delete Selected Arrays (to delete all selected arrays).

  3. A prompt appears confirming deletion. Click Yes to complete the operation.

NOTE: Make sure that any reference to deleted arrays are removed from sub-workflows or tasks, otherwise an error will occur during execution.

To edit a shared array:

  1. On the Arrays tab, right-click the array to edit.

  2. Select Edit Array from the context menu that appears.

  3. The Workflow Array dialog appears.

  4. Make the appropriate modifications and click OK to save changes.

To rename a shared Array:

  1. On the Arrays tab, right-click the array to rename.

  2. Select Rename Array from the context menu that appears.

  3. Enter a new name for the array.

NOTE: Make sure that associated workflows or tasks point to the new array name, otherwise an error will occur during execution.