FOR_EACH_VAR

LANSA Composer

FOR_EACH_VAR

This is an iterator activity. It will iterate for each processing sequence variable extant in the variable pool.  The iteration does NOT include built-in variables or internal variables.  On each iteration the output parameters provide the variable name, index and variable value.  Because it is an iterator activity, you may nest processing sequence directives beneath the FOR_EACH_VAR activity that will be executed for each iteration.

This activity is mainly intended for diagnostic purposes.  It would not normally be used in live, completed BPI solutions.  As a diagnostic aid, it will log the variable name, index and value into the processing sequence log for each iteration.  It may not be necessary, therefore, to include any processing sequence directives nested beneath this activity - the provided logging may be sufficient for your diagnostic purposes.  NB:  the Processing Sequence Editor will give a warning that the iterator item is empty, but this warning may be ignored.

The activity takes a "snapshot" of the state of the variable pool before beginning the iteration.  The following applies to any changes that occur during the iteration as a result of executing other activities or processing sequence directives:

  • processing sequence variables that are added will not be included in the iteration
  • processing sequence variables that are removed or cleared will still be included in the iteration

However, changes to the VALUES of processing sequence variables WILL be reflected in the iteration if they occur BEFORE the affected variable is iterated.

INPUT Parameters:

There are no input parameters.

OUTPUT Parameters:

VARNAME :

This output variable provides the name of the current processing sequence variable.

VARINDEX :

This output variable provides the index of the current processing sequence variable.  If the variable is not part of a list, the value will be 1 (one).

VARVALUE :

This output variable provides the value of the processing sequence variable for the current index.