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

How to find service name in webmethods which are invoked in a transformer

  • 1.  How to find service name in webmethods which are invoked in a transformer

    Posted Tue March 06, 2018 08:01 AM

    Am trying to print the names of services invoked in a FlowService using a java program. Am able to print the names of services using below code:

    import com.wm.app.b2b.server.InvokeState;
    ...
    ...
    ...
    
    InvokeState invkState = InvokeState.getCurrentState();
    //below line prints all service names which are invoked in a flow service
    System.out.println(invkState.getCallStack()); 

    However, when am using transformers and trying to invoke a custom service (which I created), the above code doesn’t print the services which are invoked via transformer. And if, I happened to use a pub service, then it displays service name but not in the case of custom service.

    Have attached image for better understanding.

    Any inputs would be highly appreciated.
    transformer.png


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


  • 2.  RE: How to find service name in webmethods which are invoked in a transformer

    Posted Tue March 06, 2018 10:18 AM

    Hi Mohammed,

    please note that Transformers are only being invoked when they have mapped outputs to the outoging pipeline of the step.

    If no output is mapped it might be that your code snippet is not recognizing the transformer.
    Can you check this?

    Regards,
    Holger


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


  • 3.  RE: How to find service name in webmethods which are invoked in a transformer

    Posted Tue March 06, 2018 11:07 AM

    Yes, you were right. I tried mapping my output to the pipeline after which my code starting display service name which was invoked using transformer.
    Really appreciate your answer. Thanks a ton.


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


  • 4.  RE: How to find service name in webmethods which are invoked in a transformer

    Posted Tue March 06, 2018 01:40 PM

    But there comes another question. What if the service which am invoking via transformer does not have any output i.e. pub.file:readerToFile or pub.file:StringToFile are used in transformer which does not have any output in which case I cannot map these services output to Pipeline of the step.

    Under these situations, how do I get my transformer service executed?


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


  • 5.  RE: How to find service name in webmethods which are invoked in a transformer

    Posted Tue March 06, 2018 02:09 PM

    Hi Mohammed,

    you will have to use regular INVOKE step then instead of MAP Step with transformer.

    You can just drag & drop the service from the package navigator into your flow service.

    See Service_Development_Help for further informations.
    Chapter 12 contains a sub-chapter “Working with Transformers”.

    Regards,
    Holger


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


  • 6.  RE: How to find service name in webmethods which are invoked in a transformer

    Posted Tue March 06, 2018 02:18 PM

    Hey Holger,

    Transformers get executed via multi threads on the go, which will let me invoke multiple services at once. Using invoke for my project consumes more time and hence, I was in need of transformers.

    But now, I realized that my transformer only works if its output is mapped with the Pipeline out.

    However, as posted in one of my previous comments, was wondering if we can get to invoke services via transformer which does not return any output such as pub.file:StringToFile etc.

    Thanks


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


  • 7.  RE: How to find service name in webmethods which are invoked in a transformer

    Posted Tue March 06, 2018 02:43 PM

    Hi Mohammed,

    in this case you can create a wrapper flow service for “invoking” the service you want and provide an output as i.e. “success” being set in the wrapper service.

    You can then call this service as a transformer by mapping the success output to your pipeline and drop it afterwards.

    Regards,
    Holger


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


  • 8.  RE: How to find service name in webmethods which are invoked in a transformer

    Posted Tue March 06, 2018 02:45 PM

    I really appreciate all your responses, time and knowledge for sharing. Was of great help.
    Thanks a ton.


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


  • 9.  RE: How to find service name in webmethods which are invoked in a transformer

    Posted Tue March 06, 2018 02:47 PM

    Hi Mohammed,

    please remember that multiple transformers in one map step are executed in no specific order.

    Did you try to measure the time for execution via Transformer and via Invoke?

    Not all services should be executed as a Transformer.

    Regards,
    Holger


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


  • 10.  RE: How to find service name in webmethods which are invoked in a transformer

    Posted Tue March 06, 2018 03:21 PM

    My custom services such as write to file, delete file and few other services have consumed less time when used these in transformers compared to the usage in flow service. And all these services input & output are independent of one another.
    Considering your advice, am creating a wrapper flow service with an output and invoking my custom services via transformers.


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