IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

HELP PLZ URGENT deep nested structure with data on each step

  • 1.  HELP PLZ URGENT deep nested structure with data on each step

    Posted Tue March 22, 2005 04:55 PM

    Hello together,

    I got an URGENT to solve problem here:
    We become a deeply nested XML structure from an external API. Sort like:
    <wbs>[0]
    …name0[0]
    …name0[1]
    …name0[2]
    …<wbs>[1]
    …name1[0]
    …name1[1]
    …name1[2]
    …<wbs>[2]
    …name2[0]
    …name2[1]
    …<wbs>[3]
    …name3[0]

    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.
    Josep


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 2.  RE: HELP PLZ URGENT deep nested structure with data on each step

    Posted Wed March 23, 2005 03:09 AM

    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.


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 3.  RE: HELP PLZ URGENT deep nested structure with data on each step

    Posted Wed March 23, 2005 10:24 AM

    Hi Rohit and Sonam,

    thanks very much for the help. I did really good to us. I solved the problem with a Java.

    Cheers,
    Josep


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 4.  RE: HELP PLZ URGENT deep nested structure with data on each step

    Posted Wed March 23, 2005 03:40 PM

    Glad that you were able to solve the problem.

    Rohit


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB