OTX Reference
|
|
Loop over a collection. More...
Public Attributes | |
CollectionTerm | collection |
Cardinality [0..1] List or Map over which the for-each-loop iterates. More... | |
Variable | locator |
Cardinality [0..1] This element must be an Integer or String Variable that will be used as the locator variable of the for-each-loop . More... | |
Variable | value |
Cardinality [0..1] This element points to a variable that shall hold the list items or map values. More... | |
Loop over a collection.
The for-each-loop
is configured by a collection (a List or a Map) and a so called locator
variable. The collection is expressed by a List or Map expression which shall be evaluated initially. The flow of the loop
shall be executed repeatedly for each item
found in the collection
. The current item of an iteration can be accessed by using the locator
variable which contains the index or key of the List or Map item, respectively. Like this, the current item can be used for any kind of computation in the loop
flow.
locator
variable is visible procedure-wide, it is accessible on the outside of the loop as well. for-each-loop
, the old value of the locator
variable shall be overwritten implicitly by the index/key of the first item of the List or Map. Similarly, the old value of the value variable shall be overwritten implicitly by the first item/value. After leaving the loop, the locator
variable value of the final iteration will be visible to the follower nodes of the loop node. for-each-loop
's collection during loop execution may cause serious inconsistencies (e.g. when a collection item is accessed which does not exist anymore). Therefore OTX runtime will throw ConcurrentModificationException when such modifications occur. By contrast, changing the value of items of a for-each-loop
's collection does not represent a concurrent modification and will not cause a ConcurrentModificationException. Exceptions.ConcurrentModificationException | It is thrown in case that the collection is modified while the loop is active. Modifications can be triggered by actions inside of the loop or from the outside, e.g.by actions in a parallel lane. |
CollectionTerm OpenTestSystem.Otx.Core.Nodes.Node.CompoundNode.Loop.LoopRealisation.LoopConfigurationHeader.LoopConfigurationRealisation.ForEachLoop.collection |
Variable OpenTestSystem.Otx.Core.Nodes.Node.CompoundNode.Loop.LoopRealisation.LoopConfigurationHeader.LoopConfigurationRealisation.ForEachLoop.locator |
Variable OpenTestSystem.Otx.Core.Nodes.Node.CompoundNode.Loop.LoopRealisation.LoopConfigurationHeader.LoopConfigurationRealisation.ForEachLoop.value |
Cardinality [0..1]
This element points to a variable that shall hold the list items or map values.