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.


#TechXchangePresenter
 View Only
Expand all | Collapse all

Looping over child recordlists

  • 1.  Looping over child recordlists

    Posted Tue March 04, 2003 06:29 AM

    Hi ,
    I’m trying to load XML to database and I have a problem in looping.
    XML format goes like this
    Workbook contains many worksheet record list and worksheet contains data record list.
    I’m trying to use nested loop.
    workbook
    worksheet
    data


    #Integration-Server-and-ESB
    #webMethods
    #webMethods-General


  • 2.  RE: Looping over child recordlists

    Posted Tue March 04, 2003 04:52 PM

    Then you need to follow 3 nested loops

    It should look like this.

    Loop-WorkBook
    –Loop WorkSheet
    –Loop Data

    Ignore this scenario if it didnt work.

    Cheers:)


    #webMethods
    #webMethods-General
    #Integration-Server-and-ESB


  • 3.  RE: Looping over child recordlists

    Posted Tue March 04, 2003 11:16 PM

    I’m also looping over Workbook , Worksheet and Data but the flow doesn’t enter Data loop.

    Thanks,
    Anu


    #webMethods-General
    #Integration-Server-and-ESB
    #webMethods


  • 4.  RE: Looping over child recordlists

    Posted Wed March 05, 2003 01:06 AM

    Hello,

    Are you sure that every time you read this xml, you will always have into a specific ? maybe you’re not receiving apropriate data and this may be causing this failure…

    Hope this helps…

    best regards.


    #Integration-Server-and-ESB
    #webMethods
    #webMethods-General


  • 5.  RE: Looping over child recordlists

    Posted Wed March 05, 2003 05:35 AM

    Hi ,

    Yes, the XML sample which I am using does have the data records under Worksheet.

    I’m trying to loop Data under worksheet and worksheet under workbook.I’m not using any temp record list in the out array of the loop.

    Thanks,
    Anu


    #Integration-Server-and-ESB
    #webMethods
    #webMethods-General


  • 6.  RE: Looping over child recordlists

    Posted Wed March 05, 2003 08:38 AM

    Two things to check:

    1. Are you typing the full path in each loop? For example, your loops should be for:

    /workbook
    /workbook/worksheet
    /workbook/worksheet/data

    1. (In wM Developer) put a map into each loop and make sure that the list you are looping over now looks like a single instance. For example:

    map1
    /workbook
    map2
    /workbook/worksheet

    In map 1, if you drill down into the record structure, workbook and worksheet will look like record lists. In map 2, workbook should look like a single record.

    Enjoy…

    JSilver


    #Integration-Server-and-ESB
    #webMethods
    #webMethods-General


  • 7.  RE: Looping over child recordlists

    Posted Wed March 05, 2003 11:13 AM

    Anu,

    Do you have content in the workbook elements?


    #Integration-Server-and-ESB
    #webMethods-General
    #webMethods


  • 8.  RE: Looping over child recordlists

    Posted Wed March 05, 2003 03:26 PM

    Hello,

    You can check if whitin a worksheet element have only one , if so, probably you will have a record instead a record list to loop through… to override this, you can create a record with your correct structure specified and in “recordName” parameter of documentToRecord service you put this record to enforce the structure to behave like you want when you import your XML, this way, you will always have a record list even when you have just one element…

    If you try this way, you’ll have to set too the “makeArrays” parameter to “false” into documentToRecord service…

    Hope this help…


    #webMethods-General
    #webMethods
    #Integration-Server-and-ESB


  • 9.  RE: Looping over child recordlists

    Posted Thu March 06, 2003 03:03 AM

    Thanks to JSilver and others ,with the full path in the nested loops I could enter the data loop and load the XML into the database.

    Regards,
    Anu


    #webMethods
    #Integration-Server-and-ESB
    #webMethods-General