Considerations When Using the Loop Adapter

The Loop adapter allows you to run subflows while incrementing a parameter's value.

Before you use the Loop adapter, it is important to understand the following information:

  • You cannot select parameter types other than the selected parameter type for expression formation or value substitution. For example, if you have a For Each loop with a real parameter, you cannot select a string parameter as one of its values; you can select only another real parameter. The only exception is that you can select integer parameters when the loop variable is real.

  • Proper loop execution requires that the parameters (iteration parameter in For and For Each loops, and condition parameters in While and Do Until loops) are mapped correctly between the parent loop and its subflows.

  • For While and Do Until loops to function properly, all parameters that are used in the conditions and that are expected to change their values during iterations must be input/output parameters. In this case their values are preserved from one iteration to another by the Loop adapter. For example, when creating a While loop with the condition (N < 10) and a calculator in the subflow with the expression N = N + 1, you must ensure that parameter N is an input/output parameter in both the Loop adapter and the Calculator adapter and that the parameter is mapped in both directions. If this is not done, parameter N's values are always reset to the initial value at every calculator execution, and the loop ends up running infinitely or until it reaches the maximum number of iterations.

  • For all loops, the values of all output or input/output parameters after the loop finishes are taken from the last iteration (highest run number, not the last iteration to finish).