0

Hi All. I need to access xml record one at a time for which I first converted XML file to Java, then iterated the payload using for each and inside declared flow variable to access the xml record. In doing so, I am just getting the last xml record instead of all xml records. Please help me in resolving the issue. Thanks in advance.

Mule code- Mule XML XML file

Community
  • 1
  • 1
Rashi Goel
  • 33
  • 7

1 Answers1

0

There are multiple issues which i can see in your code. you need to write a bit of dataweave in your transform-message component to extract each LIN from the group. otherwise the for-each has no collection to loop over.

enter image description here

please refer the screenshot above. Here is what i did

  1. created a sample data with the xml screenshot you pasted ( next time please attached the file, not images)
  2. in transform message converting the input as java at the same time assigning new payload by extracting what is required from the original payload to form a collection.
  3. this collection can now be the input for your for-each and the logger can print what you are expecting.
satish chennupati
  • 2,602
  • 1
  • 18
  • 27