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

pub.list:appendToDocumentList

  • 1.  pub.list:appendToDocumentList

    Posted Fri November 17, 2017 08:20 AM

    How to use appendToDocumentList before the loop?


    #webMethods
    #Integration-Server-and-ESB
    #edi


  • 2.  RE: pub.list:appendToDocumentList

    Posted Fri November 17, 2017 09:34 AM

    Hi,

    can you describe your issue in detail please?

    Regards,
    Holger


    #webMethods
    #Integration-Server-and-ESB
    #edi


  • 3.  RE: pub.list:appendToDocumentList

    Posted Fri November 17, 2017 02:48 PM

    This is the main xml structure:


    letter C
    letter D
    letter D
    letter F

    I need to insert below xml after element above.

    <G.G>letter G.G</G.G>
    <G.H>letter G.H</G.H>


    <G.G>letter G.G</G.G>
    <G.H>letter G.H</G.H>


    <G.G>letter G.G</G.G>
    <G.H>letter G.H</G.H>

    The final output should be like this:


    letter C
    letter D
    letter D
    letter F

    <G.G>letter G.G</G.G>
    <G.H>letter G.H</G.H>


    <G.G>letter G.G</G.G>
    <G.H>letter G.H</G.H>


    <G.G>letter G.G</G.G>
    <G.H>letter G.H</G.H>



    #webMethods
    #edi
    #Integration-Server-and-ESB


  • 4.  RE: pub.list:appendToDocumentList

    Posted Mon November 20, 2017 11:53 AM

    Hi,

    prepare a sub-document named G with fields G.G and G.H.

    are the three entries in your sample the same or different each?

    Initialize a (temporary) list of documents of type G → temp_G.
    Loop over your source list (InputArray = source_List)

    • fill fields G.G and G.H to new instance of doc_G accordingly.
    • add doc_G to list temp_G (inList=outList = temp_G, inDoc = doc_G)
    • drop doc_G
      Add temp_G to list A/B (inList=outList= A/B, inDoc=temp_G)
      Here you can drop the temp_G list when no longer needed.
      Go ahead with your document A as needed.

    Make sure that variable doc_G ist not used before the loop otherwise you might receive unpredictable behaviour in your service.
    Use the loop when the different entries of G-list are different.
    When the different entries of G-list are identical (wondering why they have to be present several times then) you can preprare one doc_G and add this to the temp_G list as many times as needed (i.e. by a REPEAT-step) and drop it (doc_G) afterwards.

    Regards,
    Holger


    #edi
    #webMethods
    #Integration-Server-and-ESB