MicroStrategy ONE

Supporting Loops in a Workflow to Attempt Configurations Multiple Times

When deploying a workflow, it may be necessary to perform the same configuration multiple times. For example, if you attempt to start Intelligence Server but it does not start successfully, you can continue to attempt to start Intelligence Server until it starts successfully, or the workflow is ended. To support this type of a workflow, you can include a loop in your workflow.

Loops should commonly be avoided in workflows because they can cause a workflow to continue to perform the same actions repeatedly with no way to end the workflow. However, you can use decision processes and the Update Parameters process (see Performing System Processes) to support loops in workflows. By including the Update Parameters process in a workflow, you can keep track of how many times a loop in a workflow is repeated. After a certain amount of attempts, the loop can be exited even if the required configuration was not completed successfully.

For example, the workflow shown below uses a loop to attempt to start Intelligence Server, multiple times if necessary, before performing a Command Manager script that requires Intelligence Server to be operational.

With the workflow shown above, if Intelligence Server starts successfully the first time, the Command Manager script is executed next and the loop is not needed. However, if starting Intelligence Server is not successful, the first thing that occurs is that the Update Loop Counter configuration updates a parameter for the workflow. A parameter named Loop is included in the workflow with the initial value of zero, and the Update Loop Counter configuration updates this parameter with the following statement:

${Loop} + 1

Using this statement, the Loop parameter is increased by one each time the Update Loop Counter configuration is executed. Once the Loop parameter has been increased, a decision process is used to check the value of the Loop parameter. If the Loop parameter is less than three, the configuration to start Intelligence Server is attempted again. This allows the configuration to start Intelligence Server to be attempted three times. If Intelligence Server still cannot start successfully, the loop is discontinued and the workflow is stopped.

To use split and merge executions in a workflow that uses logical loops, see Processing Multiple Tasks Simultaneously.