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.  Exception Handling

    Posted Thu June 26, 2003 01:00 PM

    Hi All,

    I had a question about Exception handling and good coding standards.
    Here is what i can came up with and would like to get a feed back from you folks.

        1    SEQUENCE (exit on sucess) 
    1.1    SEQUENCE (exit on failure) 
    Business Logic  
    1.2    SEQUENCE (exit on failure) 
    1.21    INVOKE getLastError  
    1.22    INVOKE logToFile  
    

    2 SEQUENCE (exit on done)
    2.1 INVOKE closeAll
    2.2 INVOKE clearPipeline

    Looking forward for your responses,

    Thanks,

    Gamad


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


  • 2.  RE: Exception Handling

    Posted Thu June 26, 2003 01:25 PM

    I’ve had good luck with this sequence:

    1 Sequence ‘Main’ (exit on done)
    1.1 Sequence ‘Try’ (exit on success)
    1.11 Business Logic
    1.12 Business Logic
    1.13 Exit Sequence ‘Main’
    1.2 Sequence ‘Catch’
    1.21 Exception Handling
    1.22 Exit Sequence ‘Main’

    In this, if sequence 1.1 completes normally, then step 1.13 enacts and the flow is exited. If, for example, 1.12 fails, then the process exits 1.1, but since ‘Main’ requires completion the process proceeds to 1.2, where the exception handling stuff is placed.

    Hope this helps!


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


  • 3.  RE: Exception Handling

    Posted Thu June 26, 2003 02:05 PM

    Gamad–the flow you outlined looks just like the try/catch handling recommended in the wM GEAR docs. That is what I’ve used with success throughout the projects I’ve worked on.

    Matthew–I assume that in 1.1 you meant to type (exit on failure). If you have exit on success, if step 1.11 succeeds the sequence will exit, skipping over 1.12 and 1.13. Set 1.1 to exit on failure and you can dump step 1.13. You can also dump step 1.22 as it is essentially a no op.


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


  • 4.  RE: Exception Handling

    Posted Thu June 26, 2003 03:42 PM

    Also, in 1 it’s usually set to EXIT ON SUCCESS so that the catch block doesn’t get executed upon a successful ‘try’ block. The Catch is usually EXIT ON DONE so that each step within the catch will be attempted.


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