Loop

Article • 02.08.2022 • 4 minute(s) to read

Loop

The Loop Activity iterates though the elements in an array. The array can be stored in a Variables or manually entered in the Loop Activity. The Loop Activity iterates the elements by:

  • Putting the current element in a Context Variable with the name given in Variable.
  • Leaving the Loop Activity by the Outcome defined in Outcome if value, as long as there are values in the array.
  • When the Instance returns to the Loop Activity, the next element is put in the Context Variable and the Activity is left by the Outcome defined in Outcome if value again, as long as there are values in the array.
  • Once all elements have been iterated, the Loop Activity is left by the Outcome defined in Outcome if no value.

In any case, each Outcome name can be used multiple times, if it is desired to continue the process in parallel. When the Activity is left, the script of the configured Outcome or Outcomes is evaluated and only Outcomes with a script evaluating to true is followed. If no Outcome script evaluates to true, Instance is ended by entering the closed-state.

Activity config

General
  • Name - Name of the Activity.
  • Version - Version of this Activity used in the Process. If a new version of this Activity is available and you want to use it, you have to manually update the version here. When a new Activity is added to the Process, automatically the latest version is placed.
  • Timeout in second - Once this time is elapsed, the Activity is closed and the Instance changes into the faulted-state. The default Timeout is two minutes. The timeout can be shortened and extended by entering a custom duration. If the Activity is left after a timeout, the first Outcome is followed. If multiple Outcomes have the same name as the first Outcome, all of them are followed. However, a continuation after a timeout does not effect the Outcome Scripts, meaning only Outcomes with Outcome Scripts evaluating to true are followed.
  • Hide in process graph - Controls if the Activity is hidden (Yes) or shown (No) in the Process Graph on the Execution Screen.
  • Continue on error - If this is set to Yes, the execution of the Instance continues even if the Activity failed. If set to No, the Instance fails when the Activity fails by entering the faulted-state. In the case of a continuation after an error, the first Outcome is followed. If multiple Outcomes have the same name as the first Outcome, all of them are followed. However, a continuation after an error does not effect the Outcome Scripts, meaning only Outcomes with Outcome Scripts evaluating to true are followed.
Loop

Loop Activity specific configurations

GENERAL

General interaction configuration, shared with most other Activities

  • Disable activity - Disables (Yes) or enables (No) the Activity. When disabled, the Activity is not executed and passed like a Connection by following the first Outcome. If multiple Outcomes have the same name as the first Outcome, all of them are followed. Disabling the Activity does not effect the Outcome Scripts, i.e., still only Outcomes with Outcome Scripts evaluating to true are followed.
  • Retry on error - If set to Yes, an automatic retry is executed up to ten times. If set to No, no retries are done. Retries are issued when the Activity failed so that the Instance would enter the faulted-state if the retry is disabled.
  • Additional text for task list - Description of this Activity shown to the Users in their task list. You can enter this text directly or use Process Context Expressions to compile it.
SETTINGS

Loop configuration

  • Value array - Sets the array that will be iterated. This can be done in two different ways:

    • The array is stored in a Variable or Attribute. Then, only one row is allowed here and this row has to contain a Process Context Expression specifying the Variable like =#[ContextVariable] or Attribute like =#[Variable.Attribute].
    • The elements to iterate over are manually entered here as literals. Each elements needs to be put into a separated row.

    A new row can be crated by clicking Add and an existing row can be deleted by clicking .

  • Outcome if value - The Instance will leave the Loop Activity via this Outcome as long as it is still iterating over the elements. Be aware the the branch leaving from this Outcome has to lead back to the Loop Activity eventually.

  • Outcome if no value - If there are no more elements left to iterate, the Loop Activity is left via this Outcome specified here.

  • Variable - Name of the Context Variable that holds the element in each iteration.