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:
-
In the Workflow Designer, select the Arrays tab.
-
Right click anywhere inside the Arrays panel to open the context menu.
-
Select Add Array, as shown below.
-
A dialog titled Array appears as shown below.
-
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:
-
On the Arrays tab, right-click the array to delete. To select more than one array, hold down CTRL during selection.
-
From the context menu that appears, select Delete Array (to delete a single array) or Delete Selected Arrays (to delete all selected arrays).
-
A prompt appears confirming deletion. Click Yes to complete the operation.
To edit a shared array:
-
On the Arrays tab, right-click the array to edit.
-
Select Edit Array from the context menu that appears.
-
The Workflow Array dialog appears.
-
Make the appropriate modifications and click OK to save changes.
To rename a shared Array:
-
On the Arrays tab, right-click the array to rename.
-
Select Rename Array from the context menu that appears.
-
Enter a new name for the array.