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
  • 1.  Can not loop in a list that have 1 item

    Posted Mon October 27, 2008 11:31 AM

    Hi all experts

    If any boby have ever met this problem, please share for me your solution

    I use a loop to insert each item in a document list to database.when number of item in document list > 1, it work well, but when number of item in document list = 1, Loop does not work. Please see detail at attachment

    Thanks for all your help
    loop.doc (36 KB)


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


  • 2.  RE: Can not loop in a list that have 1 item

    Posted Mon October 27, 2008 03:44 PM

    What does not work? From your attachment, the flow is recognizing that PkgItem has contents. Do you mean that the steps below your Loop are not executing? If so, what are those steps?


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


  • 3.  RE: Can not loop in a list that have 1 item

    Posted Mon October 27, 2008 04:36 PM

    Hi PhilLeary,
    Thanks for your reply
    Yes, the step below my Loop did not work when PkgItem has only 1 item, when PgkItem has more than 1 item, all step below my Loop was executed normaly! Those service below my Loop is Map funtion from PkgItem to database. With those information, can you help me?

    Thanks
    TanNM


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


  • 4.  RE: Can not loop in a list that have 1 item

    Posted Mon October 27, 2008 04:53 PM

    How are you getting document (the parent of PkgList)? It would appear that this is where the problem lies. As long as Loop sees a documentList type for PkgItem, it won’t care whether it has one item or more. However, if it does not see a documentList type for PkgItem, that could be a problem.

    If you are creating document from something like xmlNodeToDocument, be sure to set the “arrays” input variable to PkgItem.


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


  • 5.  RE: Can not loop in a list that have 1 item

    Posted Mon October 27, 2008 05:02 PM

    It looks like you are not generating your document right, loop is working as it is supposed to. As mentioned by Phil check if you are setting the “arrays” input while using xmlNodeToDcument service(which I believe you are using) or use the documentType input(set “makeArrays” false) if you already have the instance of PkgList document.


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


  • 6.  RE: Can not loop in a list that have 1 item

    Posted Tue October 28, 2008 04:10 AM

    Thanks PhilLeary and Talha Khan,

    As your help, in xmlNodeToDocument service, i set value"PkgItem" for Input Parameters “arrays”, It OKs.

    Thanks and best regards
    TanNM


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


  • 7.  RE: Can not loop in a list that have 1 item

    Posted Tue October 28, 2008 07:22 PM

    TanNM,

    An alternative to using the arrays parameter is to use the documentTypeName parameter. Please take a look at the Built-In Services Reference Guide.

    I personally prefer this approach because you don’t have to specify each element that must be generated as a list. All details regarding the document structure are stored in the document itself.

    • Percio

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