Configuring a For Loop

A For loop iterates through a selected parameter’s sequence of values and runs the subflow at each iteration.

For information about how parameters other than the loop index behave for sequential and parallel For loops, see About Parallel Loop Execution.

  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 Editor, click For in the Loop Type list.
  4. In the Parameter list, select a parameter or click to create a parameter.

    You can use only real or integer parameter types in a For loop.

    The selected parameter’s value is altered during every run from a starting value (the From option) to a final value (the To option) incremented in steps with a specified value (the Increment option).

  5. In the From list, select Parameter or Constant and based on your selection, select either a parameter using the corresponding list or enter a constant in the adjacent text box.

    This setting represents your starting value.

    If you choose to create a parameter, the button becomes available. Click to add a new parameter.

  6. In the To list, select Parameter or Constant and based on your selection, select either a parameter using the corresponding list or enter a constant in the adjacent text box.

    This setting represents your final value.

    If you choose to create a parameter, the button becomes available. Click to add a new parameter.

  7. In the Increment list, select Parameter or Constant and based on your selection, select either a parameter using the corresponding list or enter a constant in the adjacent text box.

    In general, the Increment value can be a real or integer value. If you selected Constant, it can be either a positive value or a negative value. Zero (0) is not a valid value for this option if you selected Constant.

    If you choose to create a parameter, the button becomes available. Click to add a new parameter.

  8. In the If a run in a loop fails then list, select the action that you want Optimization Process Composer to take if a subflow fails:
    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.
  9. Click Execute all iterations in parallel if you want all the submitted subflows to run simultaneously (in parallel).

    If this option is not selected, the subflows run one after the other (sequentially).

  10. Click Ok to save your changes and to close the Loop Editor.