Create a complex and a dynamic complex variable
Use a complex variable to hold tabular or array-based data values, such as a list of product details.
Create a complex variable
Static complex variables are an array (group) of variables of potentially different data types. Static complex variables keep their cell mappings to process variables throughout the job. Every time a mapped variable value is updated in the job, it is reflected in the static complex variable cell.
A static complex variable can only be created for a process; it cannot be created as a server variable.
-
In the
New variable dialog box, enter a unique
Name for the variable.
By default, the name of the variable becomes the ID of the variable; however, you can change the ID if needed.
- On the Type list, select Complex. (Default: String)
-
By default, Column1 is added, but you can change the column name if needed. To add more columns, do the following:
An error message appears when you try to use the same column name for other columns, stating that the "Column name already exists."
-
Click
for
Columns.
By default, the column Name is displayed as Column2.
- Select the column Type.
- Click Add.
-
Add more columns as needed.
You can modify and delete any column.
-
Click
for
Columns.
-
To configure the variable content, click
Configure contents.
The Configure complex variable content or the Configure dynamic complex variable content page appears depending on the selection. By default a single row is added under each column.
-
To configure the number of rows for the complex/Dynamic complex variable (initially, if it is dynamically updated),
enter or select the
No. of rows (default: 1) and then click
Apply.
Based on the specified number, the rows are added under each column. For example, if you add two columns, and select the “No. of rows” as 6, six rows are added under Column1 and Column2.
- You can increment or decrement the value for the number of rows. For example, if you have 2 columns and 6 rows, if you decrement the number of rows by 3 and click Apply, 3 rows are deleted, but the same number of columns (2) are retained.
-
For each column, do the following:
- Select Type, such as Bool.
- Provide a dynamic value (by mapping process or server variable) or enter a static value for each cell within a column.
You can update the type of the column while configuring the variable. If you change the type, all the cell values within that column are discarded so that you can provide the value depending on the type.
-
Click
Add and close.
A static complex variable retains its variable mappings throughout the job. Every time a mapped variable value is updated in the job, it is reflected in the static complex variable cell.
- Save the process.
Create a dynamic complex variable
Dynamic complex variables keep their cell mappings to process variables only until they are updated in the job. They are stored against the job and their array size and values can change during the course of the job.
At design time, you can create a complex variable with a maximum of 1000 cells, such as1000 X 1, 500 X 2, or 5 X 200. However, at runtime, no maximum limit is placed on the number of cells.
A Dynamic complex variable can also be created as a server variable. Both types of variables are created in the same way. However, the Process Initialization option is not available when setting up complex server variables.
Variable members can be either dynamic or static. A static value is one that a user can enter but cannot modify.
- On the Type list, select Dynamic complex. (Default: String)
-
By default, Column1 is added, but you can change the column name if needed. To add more columns, do the following:
An error message appears when you try to use the same column name for other columns, stating that the "Column name already exists."
-
Click
for
Columns.
By default, the column Name is displayed as Column2.
- Select the column Type.
- Click Add.
-
Add more columns as needed.
You can modify and delete any column.
-
Click
for
Columns.
-
To configure the variable content, click
Configure contents.
The Configure complex variable content or Configure dynamic complex variable content page appears depending on the selection. By default, a single row is added under each column.
-
To configure the number of rows for the complex/Dynamic complex variable (initially, if it is dynamically updated),
enter or select the
No. of rows (default: 1) and then click
Apply.
Based on the specified number, the rows are added under each column. For example, if you add two columns, and select the “No. of rows” as 6, six rows are added under Column1 and Column2.
- You can increment or decrement the value for the number of rows. For example, if you have 2 columns and 6 rows, if you decrement the number of rows by 3 and click Apply, 3 rows are deleted, but the same number of columns (2) are retained.
-
For each column, do the following:
- Select Type, such as Bool.
- Provide a dynamic value (by mapping process or server variable) or enter a static value for each cell within a column.
You can update the type of the column while configuring the variable. If you change the type, all the cell values within that column are discarded so that you can provide the value depending on the type.
-
Click
Add and close.
-
For a dynamic complex variable, the number of rows and columns is dynamic; they are not set at design time but are based on the return result set, such as a web service or database query.
-
The variable mappings for dynamic complex variable cells are only for initial creation and are not retained. A static complex variable retains its variable mappings throughout the job. Every time a mapped variable value is updated in the job, it is reflected in the static complex variable cell.
-
- Save the process.