Show TOC

Function documentationRepeater Locate this document in the navigation structure

 

You use this action to cycle through an XML node set, which consists of any XML nodes that are members of the same hierarchical level in the XML document. The Repeater action does the following:

  1. Starts with the first member of the node set

  2. Performs a task using information from the first node

  3. Moves to the next node

The action cycles through the nodes until all members of the node set are addressed.

Features

The properties for this action are listed in the following table:

Property

Data Type

Access

Use

Source (XPath Expression)

Boolean

In and out

The XPath expression that performs the iteration through the desired XML node set. For example, to cycle through each row of data returned from a tag query, the following expression is used: IllumTagQuery_0.Results{/Rowsets/Rowset/Row}.

You do not need to understand XPath expressions to create this action. To automatically create the proper XPath, you can search for available transaction properties and documents and select the Row element below the Rowsets/Rowset elements. By selecting the Row element, the repeater loops through each row in the result set.

For example, if you use IllumTagQuery_0.Results{/Rowsets/Rowset/Row/CylTemp1}, the action cycles through all CylTemp values for each child row of the rowset element.

You must define the Source using the Source Selection dialog box and not the Link Editor.

Output

XML

Out

The current XML segment of this action.

Break

Boolean

In and out

Stops execution of this action. The action cycles until the break condition is true or it iterates through all node sets.

If the value is true, it breaks. If it is false, it continues repeating.

ItemCount

Integer

In and out

Defines the loop counter value.

CurrentItem

Integer

In and out

Indicates the item that is being read.

Success

Boolean

In and out

Determines whether the action passed or failed. If it failed, error information is displayed in the server trace log.

Example

If you use a query action, an XML document is returned as the result. If you want to perform a set of tasks for each row in the result set, you can use the Repeater action to loop through each row. All actions that follow the Repeater action are executed for each node set.

In another example, a Repeater action is configured based on the Aggregate Query action. For each dataset row returned in that query, the following occurs:

  1. A calculation is performed and the result is written to a database through a SQL query.

  2. An XML document is saved.

  3. A blue connector line with the circle between the Repeater action and the Calculation action indicates that all child sequences of that connection are repeated for each row of data the Repeater action processes.

  4. A gray line to the XML Saver action indicates that the XML Saveraction runs only once.

Since all transactions run top to bottom and left to right, the XML Saver action does not run until the Calculation and SAP KPI Update actions have run for each repeating element.