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

Best practice : input-output vs pipeline to propagate var to sub flow service ?

  • 1.  Best practice : input-output vs pipeline to propagate var to sub flow service ?

    Posted Sat October 27, 2018 01:45 PM

    Hi,

    I’ve a big flow service and because of its size, I’m considering to split it into 2 dedicated services tasks (service1 and service2).

    Example :

    main => service1 => service2
    ------ <= service1<=

    I have a question about a document list (let’s call it error) used by service1 and service2 (but not used by external other services).

    Question:

    If service1 has error defined as OUTPUT, what would you do for the service2 :

    • would you add the error documentlist in INPUT/OUTPUT of the service2
      (mapping OUPUT service1.error → INPUT service2.error and mapping OUPUT service2.error → INPUT service1.error))
    • or because the service2 is a sub service, do you just leave service2 read the documentlist in the current pipeline ?
      (in this case, service2 don’t need neither INPUT or OUTPUT)
      ?

    Regards


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


  • 2.  RE: Best practice : input-output vs pipeline to propagate var to sub flow service ?

    Posted Sun October 28, 2018 10:10 AM

    IMO everything a service needs should be declared in its input signature. I.e. every variable in the flow must be either declared as an input parameter or be introduced (computed) in the flow itself. There are situations where a value is passed “under the hood” i.e. without declaring it in the input. But those are very rare cases, and each needs a special justification.


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


  • 3.  RE: Best practice : input-output vs pipeline to propagate var to sub flow service ?

    Posted Mon October 29, 2018 01:26 PM

    Hi Cedric,

    I agree with fml2.

    Additional thoughts:
    mapping from Service1 pipeline to Service2 input is recommended has fml2 has explained, but remapping from Service 2 output to Service 1 pipeline is only neccessary when the document is modified in the Service 2 and you need the modified variant after invocation of Service 2.
    When it is not used any longer drop it from the pipeline as earliest as possible.

    Regards,
    Holger


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


  • 4.  RE: Best practice : input-output vs pipeline to propagate var to sub flow service ?

    Posted Fri November 02, 2018 05:59 AM

    Thanks a lot for your replies.
    It usually what we do, but I wanted to be sure that is the best practice.

    Regards


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


  • 5.  RE: Best practice : input-output vs pipeline to propagate var to sub flow service ?

    Posted Fri November 02, 2018 07:40 AM

    Holger,
    but when the document is modified in Service2, why remapping to Service1 is necessary ? (I aways remap but prefer to ask the question)
    even it is modified in service2, Service1 keeps the reference of the document, and so, will get the modification, isn’t it ?


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


  • 6.  RE: Best practice : input-output vs pipeline to propagate var to sub flow service ?

    Posted Fri November 02, 2018 08:38 AM

    Hi Cedric,

    this is not easy to answer.

    Hopefully the Service Development Help contains a note about that.

    When invoking services as Transformer or as “scoped”, it is not guaranteed that the modifications of the invoked service are reflected to the pipeline of the invoking service.

    Therefore mapping the outcome of an invoked service explicitly is recommended as a best pratice.

    Regards,
    Holger


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


  • 7.  RE: Best practice : input-output vs pipeline to propagate var to sub flow service ?

    Posted Fri November 02, 2018 08:40 AM

    Thank you Holger for your advices.
    Regards


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


  • 8.  RE: Best practice : input-output vs pipeline to propagate var to sub flow service ?

    Posted Sat November 03, 2018 12:39 PM

    If you invoke a service (no matter whether it’s done via ‘invoke’ or a transformer or a scoped call) and pass in a document, the document is passed by reference. Hence all changes made to the document are made to the original. Hence, strictly speaking, you do not need to map it back, because the changes have already been made. It also does not matter whether you drop the document at the end of the called service.

    If a service makes changes to a document I prefere to declare the document as an output parameter – just to make it clear that the service does change the document. But, again, technically it’s not necessary.

    if you do not want to make the changes to the original you should make a deep clone of it (a shallow one will not suffice).


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


  • 9.  RE: Best practice : input-output vs pipeline to propagate var to sub flow service ?

    Posted Mon November 05, 2018 06:03 AM