Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Work Tasks

For-Loop Activity

  • Last UpdatedJun 21, 2024
  • 3 minute read

Action Description

The For-Loop Activity can be used to start a loop within a workflow. It is useful for repeated execution of an activity or group of activities. It must always be used along with the Next Loop Activity.

Activity Properties

The For-Loop activity has to be configured by specifying appropriate values for the different properties in the Activity Properties area. The Activity Properties can be accessed by clicking on the Activity Properties tool in the Tool Bar or by selecting the appropriate option from the right click menu for the For-Loop activity. The Activity Properties are organized under the following groups of related properties. The properties under each group are described in this topic.

Name & Description

The properties in the Name & Description group have been described below. You can use these properties to specify the name and description for the activity.

Name - This property can be used to specify a name for the activity.

Property Type: Optional (This property needs to be set only if necessary.)

Description - This property specifies a brief description to be displayed for the activity.

Property Type: Optional (This property needs to be set only if necessary.)

Configuration

The properties in the Configuration group have been described below. You can use these properties to configure the functionality of the activity.

Loop Variable - This property allows the user to specify the variable to use as the counter for the loop. It can be selected from the drop down for this property. These variables should have been declared in the Start activity.

Property Type: Mandatory (This property must be set if the action is to be executed.)

Loop Count - This property allows the user to specify the loop count, which will determine the number of iterations of the loop.

Property Type: Mandatory (This property must be set if the action is to be executed.)

Steps to set the Loop Count property

  1. To specify the loop count, click on the button for the 'Loop Count' property to open the property window.

  2. In this window, enter the count value directly in the text editor.

  3. If you want to assign the loop count dynamically during run-time, you can do so using the Field controls. For example, you can add a variable or content pointing to the loop count from the two drop downs for Field and click on the Append button. This will add the placeholder for the variable or content in the text editor. At run-time this placeholder will be replaced by the corresponding value, that is the loop count.

  4. You can manipulate the text using the appropriate tools from the tool bar. You can cut, copy and paste text, undo and redo changes, zoom in and zoom out the view as well as print the text.

  5. You can format the text, if necessary, using the formatting tools. You can make text bold or italic or change the font or size, set text color or background color.

  6. After specifying the count, click the Update button.

  7. Click the Close button to close the window without saving the parameter.

See For - Loop Count for a detailed description of the Loop Count property window.

Looping Behavior

The property in the Looping Behavior group has been described below. You can use this property to specify the looping behavior of the activity.

Loop through this action if output is - This property is used to specify the condition for looping the activity by selecting an activity output from the drop down.

Property Type: Optional (This property needs to be set only if necessary.)

Activity outputs:

The For-Loop Activity returns the following values -

Step: Displayed to indicate the loop step

Loop End: Displayed when the end of the loop is reached

Variable Not Found: Displayed when the specified variable is not found

Invalid Count: Displayed when there is an invalid loop count

Exception Behavior

Each activity has the Raise Error on Unhandled Linked Output property on click of which, it shows all the default configured mapped error outputs in red with their check boxes selected.

See Mapped Error Outputs for more details.

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in