Skip to main content

Using DoWhile Activity

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:

Step#1

Launch and create a new process in Process Designer

  • Launch Process Designer from the Windows Start menu located under IntelliBuddies Enterprise

Step#2

Create New Process

  • Click on New Process and fill in the new process details

Step#3

  • 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

Step#4

  • 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.

Step#5

Step#6

Save the process

  • From the Design tab ribbon, click on Save

Step#7

Run the process

  • From the Design tab ribbon, click on Run

Step#8

Ensure the process executes and displays the flower name and its index in the flower name array.

Download Example (C#)