0

I have a payload that is repeating which is like below:-

<FinalTest xmlns:ser="com.test://http">
<Test>
</Test>
<Test>
</Test>
..
..
</FinalTest>

I have a sequence of steps that I to execute for each Test object. Please let me know on how to use mule for each. Note that is not limited to twice like above it can be any number of times

  • It might be helpful to provide more background behind your preference not to use splitter to solve this problem. – Ryan Hoegg Aug 19 '14 at 16:10

2 Answers2

1

You can use Mule's ForEach routing processor.

You can make a collection of your objects and then use Foreach to Execute the sequesnce of steps for each of the Test objects.

More help at the following Mule documentation links.

http://www.mulesoft.org/documentation/display/current/Foreach

http://www.mulesoft.org/documentation/display/current/Foreach+Processing+and+Choice+Routing+Example

Hope this helps.

user1760178
  • 6,277
  • 5
  • 27
  • 57
0

You first need to add Mule namespace manger in your flow since your XML have namespace
reference :- https://developer.mulesoft.com/docs/display/current/XML+Namespaces
Then you can use for each :- https://developer.mulesoft.com/docs/display/current/Foreach
and XPATH
reference :- http://blogs.mulesoft.com/mule-3-6-xml-xpath-xslt-xquery3/

Anirban Sen Chowdhary
  • 8,233
  • 6
  • 39
  • 81