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.


#TechXchangePresenter
 View Only
Expand all | Collapse all

Error Handling in flow svcs

  • 1.  Error Handling in flow svcs

    Posted Thu October 28, 2004 02:11 AM

    In a try-catch sequence,
    When “EXIT $Flow and signal FAILURE” is used in try block, the pipeline
    variables vanish (in the catch block) excepting for the inputs to the main service. I need some of those variables for post-processing of errors. Can someone tell me how to retain the pipeline variables after erroring out.

    Thanks
    Vijay.


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


  • 2.  RE: Error Handling in flow svcs

    Posted Thu October 28, 2004 02:37 AM

    They should be in a object called lastError.
    So you should be able to retrieve it thru lastError\myVar.

    HTH


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


  • 3.  RE: Error Handling in flow svcs

    Posted Thu October 28, 2004 04:40 AM

    Hi Chris ,
    Not always. Its very erratic, sometimes they are and sometimes not. My test services behave well, but the current production code does not. I even looked at the nested lastErrors but could not find the variables I need. Initially I thought they were dropped in other preceding services , but found that they were intact. The variable just vanishes after the “EXIT $Flow and signal FAILURE” line. Can I set some variable so that it is persistent even after the EXIT.

    Can this problem be attributed webMethods bug. The version I am working on is 6.1.

    Thanks


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


  • 4.  RE: Error Handling in flow svcs

    Posted Thu October 28, 2004 12:24 PM

    Hi Vijay

    If you set the variables you wish to keep before you start the try/catch (set them to “”), you can use them. Otherwise, when first used within the try/catch, they will be seen as local variables and thus not available outside the try/catch when the catch is called.

    Hope this helps, Chris


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


  • 5.  RE: Error Handling in flow svcs

    Posted Thu October 28, 2004 04:48 PM

    Chris (S), thanks for pointing that out. We took a different approach previously, wherein you access the local variable through %/lastError/pipeline/myVar%, since the entire local pipeline is returned in an exception in this way. However, I’ve never attempted your approach and in some situations that seems clearer.


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


  • 6.  RE: Error Handling in flow svcs

    Posted Fri October 29, 2004 12:55 AM

    I’ve run into this before with 4.6. The exit flow and signal failure does not act the same way as a service exception thrown in a Java service. The trick we used was to create a Java service that accepted input parms to indicate the error (presumably you know what it is since you were doing exit flow and signal failure) and then throw an exception (ServiceError I think). Then getLastError will have what you expect.

    HTH.

    Rob


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


  • 7.  RE: Error Handling in flow svcs

    Posted Mon November 01, 2004 11:49 PM

    Thanks to everyone who posted the solutions. I got an opportunity to
    try and implement a solution today.
    Christian Schuit : I have used your method with success. I am little
    surprised that webMethods manual never talks about local variables or scope of a variable. They need to update their manuals.

    Michael A. Rossi :Your approach is the first one I tried. the variables were missing in “lastError/pipeline/myVar”, I am not sure
    why. We are using 6.1 version. Which version are you using.

    Rob Eamon : I haven’t tried your appraoch, but its frustrating to know that the exit $flow behaves differently than ServiceError.
    Did you try this approach with V6.1 ?

    Thanks
    Vijay .


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


  • 8.  RE: Error Handling in flow svcs

    Posted Tue November 02, 2004 12:20 AM

    Vijay,

    As long as you dont explicity drop the variables and any error occurs in the execution of flowsvc will be obtained by getLastError this variable substituion will work %lastError/pipeline/myVar%…in any verion of IS,So michael solution will work,step thru the flow whether dropping is done before you see the exception.

    or else follow Chris schuit solution which you got success.

    HTH,
    RMG.


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


  • 9.  RE: Error Handling in flow svcs

    Posted Tue November 02, 2004 05:08 PM

    Vijay: Have not yet tried 6.1 to see if there is any difference.


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


  • 10.  RE: Error Handling in flow svcs

    Posted Wed November 03, 2004 08:06 AM

    Hi Vijay

    There is a lot more to webMental then there is documented :wink:

    Best of luck, Chris


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