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

pipeline drop objects where string is null or empty

  • 1.  pipeline drop objects where string is null or empty

    Posted Mon June 18, 2018 10:07 AM

    Hello,

    I’m trying to get a list of threads where using the wm.server.query:getThreadList
    As I only want the threads that are not webM system related I want to drop all the elements where the “startedat” string is null or empty, this way I keep only my treads.

    I’ve tried to do this with “Branch” but I din’t mange to make it work.
    Can someone please provide some guide lines for this ?

    Thank you.


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


  • 2.  RE: pipeline drop objects where string is null or empty

    Posted Mon June 18, 2018 12:56 PM

    It might be that the result of the service call is not really an IData array but some other obejct type which is just correctly displayed in Designer. But doing “Branch” on it would not work.

    You can write a java service and look what object type is returned, and then get the values using getters and filter the list.


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


  • 3.  RE: pipeline drop objects where string is null or empty

    Posted Mon June 18, 2018 10:52 PM

    To get the user-defined thread list see below code, hope it helps.

    1 wm.server.query:getThreadList
    2 LOOP over threads (input array=threads, output array=threads)
    2.1 BRANCH on /threads/startedat
    2.1.1 /[^ ]/ (invoke pub.list:appendToDocumentList) – drop the objects (field names) which is not needed in the output.
    2.1.2 $default (do nothing)

    Let me know if you have any questions.


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