This documentation is for WSO2 Enterprise Service Bus version 5.0.0. For the latest ESB, view the latest WSO2 Enterprise Integrator documentation.

All docs This doc

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Table of Contents
location
maxLevel3
minLevel3
locationtop
styleborder:1
toptypeflat
separatorpipe

...

Syntax

Code Block
XML
XML
<iterate [sequential=(true | false)] [continueParent=(true | false)] [preservePayload=(true | false)] (attachPath="xpath")? expression="xpath">
   <target [to="uri"] [soapAction="qname"] [sequence="sequence_ref"] [endpoint="endpoint_ref"]>
     <sequence>
       (mediator)+
     </sequence>?
     <endpoint>
       endpoint
     </endpoint>?
   </target>+
</iterate>

...

The parameters available to configure the Iterate mediator are as follows.

Parameter NameDescription
Iterate IDThe iterate ID can be used to identify messages created by the iterate mediator. This is particularly useful when aggregating responses of messages that are created using nested iterate mediators.
Sequential Mediation

This parameter is used to specify whether the split messages should be processed sequentially or not. The processing is carried based on the information relating to the sequence and endpoint specified in the target configuration. The possible values are as follows.

  • True: If this is selected, the split messages will be processed sequentially. Note that selecting True might cause delays due to high resource consumption.
  • False: If this is selected, the split messages will not be processed sequentially. This is the default value and it results in better performance.
Info

The responses will not necessarily be aggregated in the same order that the requests were sent, even if the sequential Mediation parameter is set to true.

Excerpt
hiddentrue

Information was added to this description with reference to the question "How can i decide whether to use sequential="true" or sequential="false" ?" in the Mediators page.

Continue Parent

This parameter is used to specify whether the original message should be preserved or not. Possible values are as follows.

  • True: If this is selected, the original message will be preserved.
  • False: If this is selected, the original message will be discarded. This is the default value.
Preserve Payload

This parameter is used to specify whether the original message payload should be used as a template when creating split messages. Possible values are as follows.

  • True: If this is selected, the original message payload will be used as a template.
  • False: If this is selected, the original message payload will not be used as a template. This is the default value.
Iterate Expression

The XPath expression used to split the message.. This expression selects the set of XML elements from the request payload that are applied to the mediation defined within the iterate target. Each iteration of the iterate mediator will get one element from that set. New messages are created for each and every matching element and processed in parallel or in sequence based on the value specified for the Sequential Mediation parameter.

Tip

You can click NameSpaces to add namespaces if you are providing an expression. Then the Namespace Editor panel would appear where you can provide any number of namespace prefixes and URLs used in the XPath expression. 

Attach Path

 To form new messages, you can specify an XPath expression for elements that the split elements are attached to (as expressed in Iterate expression).

Tip

You can click NameSpaces to add namespaces if you are providing an expression. Then the Namespace Editor panel would appear where you can provide any number of namespace prefixes and URLs used in the XPath expression. 

Each Iterate mediator has its own target by default. It appears in the mediation tree as shown below once you configure the above parameters and save them.

...

The parameters available to configure the target configuration are as follows.

Parameter NameDescription
SOAP ActionThe SOAP action of the message.
To AddressThe target endpoint address.
Sequence

This parameter is used to specify whether split messages should be mediated via a sequence or not, and to specify the sequence if they are to be further mediated. Possible options are as follows.

  • None: If this is selected, no further mediation will be performed for the split messages.
  • Anonymous: If this is selected, you can define an anonymous sequence for the split messages by adding the required mediators as children to Target in the mediator tree.
  • Pick From Registry: If this is selected, you can refer to a pre-defined sequence that is currently saved as a resource in the registry. Click either Configuration Registry or Governance Registry as relevant to select the required sequence from the resource tree.
Endpoint

The endpoint to which the split messages should be sent. Possible options are as follows.

  • None: If this is selected, the split messages are not sent to an endpoint.
  • Anonymous: If this is selected, you can define an anonymous endpoint within the iterate target configuration to which the split messages should be sent. Click the Add link which appears after selecting this option to add the anonymous endpoint. See Adding an Endpoint for further information.
  • Pick from Registry: If this is selected, you can refer to a pre-defined endpoint that is currently saves as a resource in the registry. Click either Configuration Registry or Governance Registry as relevant to select the required endpoint from the resource tree.
Info
titleNote

You can configure the mediator using XML. Click switch to source view in the Mediator window.

...