Task Action: Loop

The loop action allows to express the repetition of a sub Task passed as a parameter. Similarly to for loop construction in many imperative language, this action express the iteration over a range, through INCLUSIVE boundaries.

Additionally the loop action declares automatically a i variable containing the current loop index.

Therefore the following expression:

loop("0", "3",
    .setProperty("name", Type.STRING, "node_{{i}}")

Will print the following output in console:


In addition, loop action parameters are templates and can express math expression such as "{{=3-1}}" therefore, exclusive bounds can be build this way.

Finally, the loop action is transient and will not modify the current context. Therefore, the task context after the loop action remains unchanged. If a cumulative result has to be built, the best is to use a addToVariable action within the repeated sub task.

results matching ""

    No results matching ""