I got an URGENT to solve problem here:
We become a deeply nested XML structure from an external API. Sort like:
In each nesting I need to extract the field ‘name’. We do not know, how deep the nesting will be, so I could not biuld a static loop nesting.
Anybody got a clue in how to handle this?
Thanks in advance.
You can also do recursion in flow, so the approach below should work:
SERVICE recurseXX takes ‘record’ input
- IF EXIT CONDITION…
- BRANCH on /WBS
- MAP name1, name2, etc…
- MAP /WBS/WBS -> tempRecord
- INVOKE recurseXX with ‘tempRecord’->‘record’
- MAP results
One thing I would be careful while doing recursion (in Java, or in Flow) about is stack overflow. I think a default IS install can do about 60 nested levels of recursion in flow before overflowing the stack. Rohit’s Java service may be more efficient in this regard. The Java stack size can be increased on startup - it is the -Xss flag I think.
Hi Rohit and Sonam,
thanks very much for the help. I did really good to us. I solved the problem with a Java.
Glad that you were able to solve the problem.