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.  Check if Pipeline Empty

    Posted Tue March 22, 2022 02:06 PM

    Hi there. I’m working on a flow service where I want to check and see if the pipeline is empty, then exit the flow.

    Is there a util or service that checks if the pipeline is empty or null? As shown in the screenshot there are no variables in the pipeline. So some service that returns pipelineIsEmpty == true, or something similar.

    image


    #Service-Designer
    #Integration-Server-and-ESB
    #webMethods


  • 2.  RE: Check if Pipeline Empty

    Posted Tue March 22, 2022 04:07 PM
    public static final void pipelineSize(IData pipeline) throws ServiceException {
    IDataCursor idc = pipeline.getCursor();
    int i = IDataUtil.size(idc);
    IDataUtil.put(idc, "size", i+"");
    IDataUtil.put(idc, "isEmpty", (i > 0) + "");
    idc.destroy();	
    }
    

    #Service-Designer
    #Integration-Server-and-ESB
    #webMethods


  • 3.  RE: Check if Pipeline Empty

    Posted Tue March 22, 2022 04:09 PM

    thanks for the response. so there’s no way outside of a java service to get this functionality?


    #webMethods
    #Service-Designer
    #Integration-Server-and-ESB


  • 4.  RE: Check if Pipeline Empty

    Posted Tue March 22, 2022 04:46 PM

    Not that I know of. But even all of the services in WmPublic end up as Java at some point. :slight_smile:

    I assume you have your own “Public” package to hold your common helper services for use by any/all packages. This would be a good one for that package. We have one that holds various string manipulations, hashmap, hashset, linked list, doc sorting (before WmPublic had one), I/O, replacement for all the math services to avoid using float/double, etc.

    Going completely the other way, I’m not sure of the value of this particular service. What is the scenario in which a service would take an action only if the pipeline is empty (or not empty)?


    #Integration-Server-and-ESB
    #webMethods
    #Service-Designer