...
Note |
---|
Iterate mediator is quite similar to the ForEach mediator. You can use complex XPath expressions to conditionally select elements to iterate over in both mediators. Following are the main difference between ForEach and Iterate mediators:
When you use ForEach mediator, you can only loop through segments of the message and do changes to a particular segment. For example, you can change the payload using payload factory mediator. But you cannot send the split message out to a service. Once you exit from the for-each loop, it automatically aggregates the split segments. This replaces the for-each function of the complex XSLT mediators using a ForEach mediator and a Payload Factory mediator. However, to implement the split-aggregate pattern, you still need to use Iterate mediator. |
Table of Contents | ||||||
---|---|---|---|---|---|---|
|
...
Syntax
Code Block | ||
---|---|---|
| ||
<for-each expression="xpath" [sequence="sequence_ref"] [id="foreach_id"] > <sequence> (mediator)+ </sequence>? </for-each> |
...