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

Appending to object list

  • 1.  Appending to object list

    Posted Wed July 13, 2005 12:27 AM

    Hi,
    Does anybody know how to append to an object list ?
    Shubhro


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


  • 2.  RE: Appending to object list

    Posted Wed July 13, 2005 02:58 PM

    Shubhro,

    to append an object to an object list, I’m creating a kind of buffer and passing it as parameter to the component called pub.list:appendToDocumentList. Example:
    let’s suppose we have a document with a document list with the following fields: A,B and C. To append an information to this document list you just have to create a temporary document (buffer) with the same fields and same types. So, the temporary document will have A, B and C fields.
    After this you use the pub.list:appendToDocumentList in this way:

    the parameter toList receives the document List you have
    the parameter fromItem receives the temporary document (buffer)
    the parameter fromList doesn’t receive nothing

    the output parameter named as toList, you have to assign it to your document list.

    Done.

    Regards,
    Kleber Ferreira


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


  • 3.  RE: Appending to object list

    Posted Wed July 13, 2005 03:18 PM

    Hi Kleber,
    Thanks for you reply.
    I am able to append Documents to Document Lists.
    I have a problem when I try to append a Object to a Object List.
    If I try using pub.list:appendToDocumentList for appending to Object Lists I get a blank document list as an output.
    Basically I am looking for something like pub.list:appendToObjectList, which does not exist now and I am sure there must be a reason why .
    Shubhro


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


  • 4.  RE: Appending to object list

    Posted Wed July 13, 2005 03:46 PM

    I would suggest writing a java service.


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


  • 5.  RE: Appending to object list

    Posted Wed July 13, 2005 03:49 PM

    Ok Shubhro,

    just to test and find out if you can change your document like this:
    instead of objectList try document list instead and each field of this document will be an object…
    After this you can try the pub.list:appendToDocumentList
    I hope it could help you…

    Regards,

    Kleber Ferreira


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


  • 6.  RE: Appending to object list

    Posted Wed July 13, 2005 04:04 PM

    Kleber,
    I had tried appending to a document list each of whose field is an object, and that works.
    But again, it gives me a document list, not an object list .
    I think, as Adnan suggested, a java service is the way to go.
    If anybody already has it, it would be great if it can be shared.
    Thanks,
    Shubhro


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


  • 7.  RE: Appending to object list

    Posted Wed July 13, 2005 04:11 PM

    Shubhro,

    maybe you can mix the solutions:
    you can create a Java service in order to convert a document list in a object list…

    Regards,

    Kleber Ferreira


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


  • 8.  RE: Appending to object list

    Posted Wed July 13, 2005 04:55 PM

    Hi,

    Check out this PSUtilities.misc.appendObjectList method.

    Regards.


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


  • 9.  RE: Appending to object list

    Posted Wed July 13, 2005 05:14 PM

    QN, thanks a ton. This package is a goldmine.
    Shubhro


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


  • 10.  RE: Appending to object list

    Posted Wed July 13, 2005 05:40 PM

    Keep in mind that all the wM-supplied “appendTo*List” methods are very inefficient when the lists become large. I’ve observed speed issues when the list reaches about a thousand entries (your mileage will vary based on many factors). If you know your list will grow only to a couple thousand entries or less, then using appendTo… will be fine. If it can grow to much more than that, then you’ll need to write Java services to place objects in a java.util.LinkedList or other appropriate Collection and when the list is fully populated, convert it to an Object List (an array of Java Objects) in the pipeline for subsequent looping/processing.

    HTH


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