Configuring a For Array Loop

You can configure the For Array loop, which iterates once for each element of the array.

  1. From the Flow section of the action bar, click Loop and drop it on the process diagram.
  2. Double-click Loop.
    The Loop Editor appears.
  3. From the Loop Type list, click For Array.
  4. Select a Subflow parameter.

    This parameter must be a scalar parameter or element of an array parameter with the same data type as the array.

  5. In the Array Parameter list, select a parameter or click to create a parameter.
  6. In the Mapping Direction list, select one of the following:
    OptionDescription
    To subflow Copies elements of the array to a scalar variable in the subflow before the subflow executes.

    This is the default option for an input array parameter.

    To/From subflow Copies each element of the array into a variable in the subflow, runs the subflow, and copies the scalar variable’s resulting value back into the array element.

    This is the default option for an input/output array parameter.

    From subflow Copies the value of the scalar variable into an element of the array after the subflow runs.

    This is the default option for an output array parameter.

  7. Click to create a mapping from your selection and add it in the mapping table.

    The loop iterates through these mappings.

    Note: You can delete a mapping from the table by selecting a mapping and clicking .

    By default, the loop executes once for each element of the array.

    If there are several arrays and the arrays have different sizes, the loop executes once for each element of the smallest array. The extra elements in the other arrays are not used or modified.

  8. Repeat Step 3 through Step 7 to add additional arrays.

    There is no limit to the number of arrays that you can map to a For Array loop.

  9. Click Design Matrix to view the values that will be used for each subflow run.

    The design matrix shows only the input and input/output mappings. The first column contains the run number, and the other columns contain the values of the scalar subflow variables for that run.

  10. Click OK to close the Design Matrix dialog box and to return to the Loop Editor.
  11. Optional: Click Limit the number of loops.

    Typically, you can use this option to limit the number of iterations.

  12. Select one of the following options for If a run in a loop fails then:
    OptionDescription
    Fail Loop Select this option if you want the Loop adapter to fail when the subflow fails.
    Ignore run and Continue Select this option if you want the run to continue after a subflow fails.

    This option applies to both parallel and sequential execution.

  13. Click Execute all iterations in parallelto run all submitted subflows simultaneously rather than sequentially.
  14. Select OK.