Do While loop is a control flow statement that executes a set of activities in a block at least once and then either repeatedly runs the block or steps out of the loop, depending on a given boolean condition at the end of the block.
Let us understand Do While activity with an example process. An example takes an array of flower names and displays names with index as output. Note: The flower name at index 0 is also displayed though the condition is > 0, because the condition is checked after first execution of the Do While block.
Come, let's create this process in Process Designer:
Launch and create a new process in Process Designer
- Launch Process Designer from the Windows Start menu located under IntelliBuddies Enterprise
Create New Process
Click on New Process and fill in the new process details
Add an array variable to hold a list of flower names.
Int32 variables to hold counter to iterate and length of the array.
Add Assign activity to assigh length of array to appropriate variable
Add Do While condition to loop till the lenght of the array.
Add condition using counter variable
Executes the activities present inside the Body of this activity till the condition is true, excluding the first iteration.
- Add Writeline to display the output
Save the process
- From the Design tab ribbon, click on Save
Run the process
- From the Design tab ribbon, click on Run
Ensure the process executes and displays the flower name and its index in the flower name array.
Download Example (C#)