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.



#Automation


#Applicationintegration
#webMethods
#Integration
 View Only
  • 1.  Try Catch inside of a Try

    Posted 08/27/19 09:02 PM

    Is there a way to embed a “try catch” within a “try”?

    I have a flow service with a main “try catch” statement. Within the main “try” I am implementing “pub.client:smtp”. Currently, if the email server is down, it results in an error in the flow service, and the flow service exits. However, in the event of an error related to “pub.client:smtp”, I just want the flow service to move on with the rest of the code inside of the “try”.

    I’ve tried embedding another “try catch” inside of the main “try” statement; however it doesn’t appear to work. I’m on IS version 10.1.

    What would be the best way to implement this? Thanks.


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


  • 2.  RE: Try Catch inside of a Try

    Posted 08/28/19 12:39 AM
    
    -main - success (outer)
    --try - failure
    ---a=1
    ---main - success (inner)
    ----try - failure
    -----smtp invoke
    ----catch - done
    -----log error or do nothing
    ---b=1
    --catch - done
    ---log error or do nothing

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


  • 3.  RE: Try Catch inside of a Try



  • 4.  RE: Try Catch inside of a Try

    Posted 08/28/19 12:41 PM

    Hi Mahesh,

    Thanks for your reply. The problem appears resolved now.

    Initially I tried with the inner “try” set to failure and the inner “catch” set to done; however, when the smtp service threw the error, the flow service went to exit without completing.

    But setting the inner “try” to done appeared to do the trick. In this instance, I did not even need the inner “catch”. When the smtp service threw the error, the flow service moved on and completed.

    Thanks,

    Ken


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


  • 5.  RE: Try Catch inside of a Try

    Posted 08/28/19 11:56 PM

    That’s good, hope it is working as expected, you can mark this thread as “Closed” Thanks


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


  • 6.  RE: Try Catch inside of a Try

    Posted 09/25/19 04:41 AM

    How can I get the same functionality using the new TRY_CATCH and TRY-FINALLY available on the new Service Designer ?


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


  • 7.  RE: Try Catch inside of a Try

    Posted 10/11/19 04:37 AM

    Hi All,

    I have below scenario for try/catch, could you please me on understanding?

    1.) Seq–Main (exit on - Success)
    Seq–Try (exit on - Success)
    Seq–Catch(exit on - Done)

    2.) Seq–Main (exit on - Success)
    Seq–Try (exit on - Success)
    Seq–Catch(exit on - Done)
    Seq–Finally(exit on - Done)

    3.) 2.) Seq–Main (exit on - Success)
    Seq–Try (exit on - Success)
    Seq–Catch(exit on - Done)
    Seq–Finally(exit on - Success)

    in above scenario catch and finally will execute or not.


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