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

Release 10.3 TRY-CATCH, TRY-FINALLY, CATCH, and FINALLY.

webMethods Community Member

webMethods Community MemberFri October 18, 2019 03:44 AM

  • 1.  Release 10.3 TRY-CATCH, TRY-FINALLY, CATCH, and FINALLY.

    Posted Sat October 20, 2018 11:36 AM

    Hi PD Team,

    Designer 10.3 now provides the following new flow steps for in the palette view and context menu:
    TRY-CATCH,
    TRY-FINALLY,
    CATCH, and FINALLY which is a cool feature and saves time and several clicks of a button.

    The functionality works fine, however, the Exit on property is set to FAILURE (unchangeable) for CATCH and FINALLY step. Is this is a UI typo error or any specific reasons? Attached screenshots.

    Also, I could not find any trace of this in the docs “10-3_Service_Development_Help.pdf”

    Let me know if you need any further details.


    #webMethods
    #Integration-Server-and-ESB


  • 2.  RE: Release 10.3 TRY-CATCH, TRY-FINALLY, CATCH, and FINALLY.

    Posted Mon October 22, 2018 09:43 AM

    For try, catch, and finally, exit-on failure is the only permitted value. There was some internal debate as to whether we should not show the value at all, or to show it indicating that it was a fixed value. The rationale is explained in the doc, which will be released as a doc update in the near future.

    We decided to implement the semantics of Java try-catch-finally as closely as possible, which required that exit-on be limited to failure.


    #Integration-Server-and-ESB
    #webMethods


  • 3.  RE: Release 10.3 TRY-CATCH, TRY-FINALLY, CATCH, and FINALLY.

    Posted Mon October 22, 2018 10:39 AM

    Hi Bernie,

    Is there a plan to bring together these 2 styles of exception handling in flow services? In the sense of a “migration” tool from the old style to the new one.

    Of course, there is the possibility of leaving this to each client and they can do it:

    • manually, one by one
    • automatically, by using custom created tools

    Thanks.


    #Integration-Server-and-ESB
    #webMethods


  • 4.  RE: Release 10.3 TRY-CATCH, TRY-FINALLY, CATCH, and FINALLY.

    Posted Mon October 22, 2018 11:50 AM

    OK wow this seems to be a great feature finally…:slight_smile:

    We hope this will be streamlined soon covering more in the docs/guides

    Cheers!
    RMG


    #webMethods
    #Integration-Server-and-ESB


  • 5.  RE: Release 10.3 TRY-CATCH, TRY-FINALLY, CATCH, and FINALLY.

    Posted Mon October 22, 2018 05:10 PM

    Hi Vlad,
    There are tens of thousands of customer Flows out there so we made every attempt to preserve old behavior. Old Flows work unchanged. In fact if anyone finds an old Flow that works differently it should be reported as a bug. The challenge was to add in the new behaviors in a way that preserve the old behavior as well.

    I think there probably are typical old-style sequence patterns that could be automatically converted. The first challenge is to catalogue the various patterns and then design a tool that recognizes the various patterns.

    We are working on a doc update that includes a lot of details, including information about comparability.

    Bernie


    #Integration-Server-and-ESB
    #webMethods


  • 6.  RE: Release 10.3 TRY-CATCH, TRY-FINALLY, CATCH, and FINALLY.

    Posted Mon October 22, 2018 06:42 PM

    Thanks Bernie and all for the comments on this topic.

    We are looking forward for the document which can give us more details. Please drop us a note once it is released.


    #Integration-Server-and-ESB
    #webMethods


  • 7.  RE: Release 10.3 TRY-CATCH, TRY-FINALLY, CATCH, and FINALLY.

    Posted Mon October 22, 2018 09:39 PM

    Interesting. I’d be interested in understanding a bit of the debate about why these were introduced at all. I can honestly say that I’ve never once thought “I wish there was a finally construct” when writing FLOW. The try/catch structure has been wholly sufficient. But maybe I’m missing something.

    What are others thinking about doing with this that cannot be done now? Is it purely a readability concern? Indeed, I’m trying to think about a scenario where FINALLY would be useful, and could not be handled in the “traditional” catch sequence.


    #webMethods
    #Integration-Server-and-ESB


  • 8.  RE: Release 10.3 TRY-CATCH, TRY-FINALLY, CATCH, and FINALLY.

    Posted Tue October 23, 2018 01:08 PM

    Hi Rob,

    one thing might be connection handling, i.e. SFTP connections.

    Login will be handled in its own try/catch (for the case it fails) and then the sessionkey is propagated to the get- and put-services et al.
    In the Catch section the session can be closed on any processing error, for success it should be closed in the Try section.
    But to be sure, that it has been definitely closed without leaving open threads you can close it in the Finally section again.

    Regards,
    Holger


    #webMethods
    #Integration-Server-and-ESB


  • 9.  RE: Release 10.3 TRY-CATCH, TRY-FINALLY, CATCH, and FINALLY.

    Posted Tue October 23, 2018 02:09 PM

    I’ve given myself a head smack for my “duh” moment. I got so wrapped up in thinking about “I can do this now with the existing sequence structures” I forgot about the raison d’etre of finally – don’t repeat yourself. :slight_smile:

    FTP/SFTP/SSH connections are indeed the scenario I had in mind – and we use the try/catch sequence structure to close on error, as you describe. We can now put this, and other “clean up” code, in the finally block instead of the same steps in 2 places.

    Thanks for the gentle reminder!


    #webMethods
    #Integration-Server-and-ESB


  • 10.  RE: Release 10.3 TRY-CATCH, TRY-FINALLY, CATCH, and FINALLY.

    Posted Tue October 23, 2018 02:27 PM

    Another scenario is large file handling or stream handling, where the handler should be closed at the end regardless of the outcome of the processing.


    #webMethods
    #Integration-Server-and-ESB


  • 11.  RE: Release 10.3 TRY-CATCH, TRY-FINALLY, CATCH, and FINALLY.

    Posted Fri November 02, 2018 11:30 AM

    Back when the Integration Server was first created by webMethods the company, flow was meant to be a tool that could be used by non-developers and therefore these strange flow steps were created to make it graphically intuitive. Sadly setting up basic control flow steps for a programmer didn’t make intuitive sense and hasn’t for a long time. So I welcome this improvement.

    I personally would like to see if-then-else implemented too.


    #Integration-Server-and-ESB
    #webMethods


  • 12.  RE: Release 10.3 TRY-CATCH, TRY-FINALLY, CATCH, and FINALLY.

    Posted Fri November 02, 2018 11:54 AM

    This reminds me of Dan Green’s old, old post where he stated “Without sounding melodramatic, Java developers can significantly increase a project’s time-to-market and ruin your ROI.”

    It is a delicate balance SAG needs to maintain with FLOW. Add useful features but don’t get too much like Java.

    BRANCH is if-then-else.


    #webMethods
    #Integration-Server-and-ESB


  • 13.  RE: Release 10.3 TRY-CATCH, TRY-FINALLY, CATCH, and FINALLY.

    Posted Sun November 04, 2018 06:13 PM

    @ Yunus,

    As Rob mentioned Branch => If/Else or Switch Case, and others steps like Loop => For, Repeat => Do While

    If you need the if-then-else construct, feel free to raise it on SAG Brainstorm.


    #webMethods
    #Integration-Server-and-ESB


  • 14.  RE: Release 10.3 TRY-CATCH, TRY-FINALLY, CATCH, and FINALLY.

    Posted Thu October 17, 2019 07:30 AM

    What is the difference between using TRY - CATCH - FINALLY in webMethods 9.8 version and using TRY-CATCH/TRY-FINALLY in 10.3 version ?


    #webMethods
    #Integration-Server-and-ESB


  • 15.  RE: Release 10.3 TRY-CATCH, TRY-FINALLY, CATCH, and FINALLY.

    Posted Thu October 17, 2019 12:17 PM

    There is no try/catch/finally construct in 9.8. It can be simulated using various combinations of exit-on DONE, exit-on FAILURE, etc. Since there was no standardized way to perform the try/catch/finally pattern, it was difficult to easily determine the implementer’s intent when viewing a Flow. It was also very difficult to implement nested try/catch blocks. The 10.3 release added formal definitions for try/catch/finally in order to address these issues.


    #Integration-Server-and-ESB
    #webMethods


  • 16.  RE: Release 10.3 TRY-CATCH, TRY-FINALLY, CATCH, and FINALLY.

    Posted Thu October 17, 2019 12:29 PM

    Thank you for the quick response and clarifying the doubt.

    One more thing: since we cannot edit the “Exit on” property from CATCH/FAILURE , how will it work? As in the previous versions, we used to edit/provide in, say, CATCH - Exit on: DONE or FAILURE - Exit on: DONE. Do we have to use the previous methods to do that?


    #Integration-Server-and-ESB
    #webMethods


  • 17.  RE: Release 10.3 TRY-CATCH, TRY-FINALLY, CATCH, and FINALLY.

    Posted Thu October 17, 2019 01:04 PM

    The goal with Flow try/catch/finally is to capture the essence of Java try/catch/finally while not compromising the overall nature of Flow.

    The Java try, catch, and finally blocks execute until there is a failure; thus the Flow try, catch, and finally blocks are hard-wired to do the same.

    There is no similar idea within Java, execute until complete, but this can still be accomplished with sequence exit-on DONE, though there is no catch or finally possible when using sequence. Any Flow that used to work will still work without change; the TCF behavior is strictly additive.


    #webMethods
    #Integration-Server-and-ESB


  • 18.  RE: Release 10.3 TRY-CATCH, TRY-FINALLY, CATCH, and FINALLY.

    Posted Fri October 18, 2019 03:44 AM

    Thank you Bernie for clarifying. :slight_smile:


    #webMethods
    #Integration-Server-and-ESB


  • 19.  RE: Release 10.3 TRY-CATCH, TRY-FINALLY, CATCH, and FINALLY.

    Posted Wed December 11, 2019 01:59 AM

    Below are few scenarios where Finally block can be used :-

    1. To close FTP session opened in try block.
    2. For service retry scenarios.
    3. If it is a trigger service, withDB operations, and if DB resource is unavailable, use finally block to suspend trigger. In This case, we need to have a monitoring service in trigger to monitor for DB resource.

    #webMethods
    #Integration-Server-and-ESB