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.



#Automation


#Applicationintegration
#webMethods
#Integration
 View Only
  • 1.  Find value

    Posted 03/05/10 11:50 AM

    Hi,

    is there any nice posibilities (e.g. public service) which can help me to get particular parameter value for specific parameter name .

    For example, I’ve got list of document:

    • test (docTest)
      • name (parameterName)
        -value (parameterValue)

    i need to get value for name : “surname”.

    Thanks for all replies


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


  • 2.  RE: Find value

    Posted 03/05/10 04:40 PM

    A basic approach:

    Loop over the document list
    …Branch on doc/name
    …surname: MAP (map doc/value to output)


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


  • 3.  RE: Find value

    Posted 03/05/10 07:40 PM

    thx ,

    but I know this approach and i’m looking more sophisticated solution.
    I quess there’s no better approach.


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


  • 4.  RE: Find value

    Posted 03/05/10 07:44 PM

    Pretty much any solution will boil down to looping and comparing.

    Another possibility is to load the list of items into a hashmap. If you’re doing many lookups this might be worth the overhead.


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


  • 5.  RE: Find value

    Posted 03/25/10 08:53 AM

    dont want looping, do Xpath:

    1. Get xml node from the document:
    • pub.xml:documentToXMLString
    • pub.xml:xmlStringToXMLNode
    1. Do Xpath:
    • pub.xml:queryXMLNode, String Output named as vals, with variables query (use XQL):
      docTest/doc[name=“surname”]/value

    struct doc:
    docTest …IData
    doc …IData
    name …String
    value …String
    xpath2.jpg


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


  • 6.  RE: Find value

    Posted 03/25/10 11:43 AM

    Not sure but to my mind all these transformations documentToXMLString → XmlStringToXMLNode → queryXMLNode may result in a “high” ressource usage if you call them a lot (no ?)


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


  • 7.  RE: Find value

    Posted 03/25/10 01:17 PM

    You can use XPath in setValue, if the path to your field is fix. Unfortunately xpath in setValue does not evaluate conditions, if your path is flexible I only the possibilities already posted by Rob and Ayell. I used pub.xml:queryXMLNode some times myself, but that was mainly for smaller structures.


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


  • 8.  RE: Find value

    Posted 03/25/10 10:28 PM

    i agree with Reamon comments on this one.


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


  • 9.  RE: Find value

    Posted 03/26/10 07:11 PM

    PSUtilities has a service that may be what you’re looking for or it can at least get you going in the right direction so you can write your own generic Java service to do this:
    ps.util.list:filterDocumentList

    • Percio

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