Loops - Kaholo

Loops

In this example, we use the Hello World process to demonstrate the Loop creation. A loop causes the process to be executed repeatedly.

1. Open the project and select the pipeline that you want to create the loop from.

2. Ensure that the process is already linked to the Start icon. On the Right side of the process, click the process circle.

3. Connect the link and to the Left side of the process circle of the selected process.

4. After drawing the loop, add a condition by clicking the Conditions drop-down menu.

5. In the Condition field, enter i < 5.

6. Next, click the Flow Control drop-down menu to configure the flow control settings. See Flow Control to learn more.

7. In the Process coordination field, click the drop-down arrow and select Run for each in link.

8. Add a Post  Hook function by clicking the Hooks drop-down menu. See Hooks to learn more.

 

9. In the Post Hook function field, enter doCondition().

10. Go to the Code environment and implement the following codes:

        1. In the First line, enter let i = 0;
        2. In the Second line, enter function doCondition( ) {
        3. In the Third line, enter i++;
        4. In the Fourth line, enter }

i = 0;
Function doCondition() {
            I++;
}

An alternative way to establish a condition is to replace the function code within the Hooks menu with i++; which will work the same way.

11. Click the Save button to apply the changes and click Execute to run the loop.

 

12. Check execution results. (Link should scroll the website down to Execution Results)

Loop Execution Results

Access the pipeline’s Execution Results tab to view its execution results. In this page, you can view the following:

  1. Executions: this section shows the number of times the pipeline has been executed with dates and time stamps.
  2. Results: this section shows the data displayed for the selected agent and the number of executions the loop executed.
  3. Execution Summary: this section shows the loop’s execution details from start to finish, execution ID, revision ID, trigger type, and configuration. It also shows the status bagel that displays the number of times the loop’s success/failed executions.
  4. Raw output: this section displays the raw output of the loop’s actions and results.
  5. Execution Actions Details: this section displays the loop’s execution of actions for the selected pipeline.

 

For more information on execution results, see Understanding the Execution Results.

 

Close Menu