1 Reply Latest reply on Jan 22, 2013 7:44 AM by Radim Vansa

    AFTER INVOKE bar() with bar() throwing an exception

    Bela Ban Master

      Hi there (Andrew),

       

      (I searched the web but haven't found an answer to this problem)...

       

      I have a rule that needs to do something after bar() has been invoked, *regardless* of whether bar() returns normally or throws an exception:

       

      RULE

      CLASS Foo

      METHOD bla

      AFTER INVOKE bar

      IF TRUE

        DO System.out.println("action invoked");

      ENDRULE

       

       

      The action gets only triggered when bar() returns normally. I was kind of hoping this would also be fired even when bar() (or code it called) threw an exception, but that doesn't seem to be the case.

       

      How can I achieve this ?

       

      Thanks !