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.  Try Catch Finally

    Posted Wed January 04, 2012 02:23 PM

    How can we implement Try - Catch - Finally Structure in Flow?


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


  • 2.  RE: Try Catch Finally

    Posted Wed January 04, 2012 03:20 PM

    Hi,

    I know how to do the Try-Catch but I’ve never used the Finally!

    • First create a SEQUENCE step and configure the “Exit on” property with value, “SUCCESS”.
    • Within this Sequence step, create two child SEQUENCE steps.
      The first child SEQUENCE step (Try block) must have the “Exit on” property value set to “FAILURE” and the second child SEQUENCE step (Catch block) “Exit on” property value must be set to “DONE”.

    Hope this helps.


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


  • 3.  RE: Try Catch Finally

    Posted Thu January 05, 2012 09:10 AM

    –Sequence (Exit on Success) Try/Catch
    ----Sequence (Exit on Failure) Try
    ----Sequence (Exit on Done) Catch
    –Sequence (Exit on Done) Finally

    In your catch block if you call ‘Exit’ flow step by setting ‘Exit with Failure’, the flow service will get terminated without going into the Last sequence.

    HTH
    Senthil


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


  • 4.  RE: Try Catch Finally

    Posted Thu January 05, 2012 03:52 PM

    Thanks for the reply.

    i was trying to figure out using the mentioned structure,
    So if we are using the finally block as shown above, should i remove the ‘Exit with Failure’ setting or should i remove the Exit step itself?

    -Regards,
    ssagar


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


  • 5.  RE: Try Catch Finally

    Posted Thu January 05, 2012 04:27 PM

    I believe you don’t have to use Finally block sequence and just use catch block with Exit with Failure step at the end and it will throw error (this will help rollback situations working as expected)

    Correct me Senthil If I am wrong:

    HTH,
    RMG


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


  • 6.  RE: Try Catch Finally

    Posted Thu January 05, 2012 05:38 PM

    Be careful that you understand the scope of pipeline variables. Although the terminology being used (try, catch, finally) is equivalent to Java be aware that the behavior is not the same as Java.

    Another tip: don’t go overboard with using try/catch sequences. Use them only when they do something useful.


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


  • 7.  RE: Try Catch Finally

    Posted Fri January 06, 2012 10:52 AM

    Thanks for your suggestions, Rob, RMG, Senthil and Kratos


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