commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fasih" <>
Subject Re: [scxml] Handling exceptions thrown by custom actions
Date Tue, 16 May 2006 04:08:29 GMT
When you say a custom action, I believe it is your custom action. Now, going 
by the Java programming practices, "dont catch an exception if you cant 
handle it and dont throw one when you know no-one can catch it", I would 
rather fire an application.error event with the exception msg as the payload 
than throw the exception. To me it makes much more sense as this is what the 
SCXML can understand, else handle the exception in Java.
By the way, looking at the API for execute I believe that the concept of 
derived events was added to signal that the event has resulted from some 
other event (As in an exception event as a result of the orig event) once it 
is an event, handling it would be simple.

My thoughts anyways, there might be better alternatives.

----- Original Message ----- 
From: "Nestor Urquiza" <>
To: "Jakarta Commons Users List" <>
Sent: Monday, May 15, 2006 9:47 AM
Subject: [scxml] Handling exceptions thrown by custom actions

> Hello guys,
> Could you point me to what you think might be the best
> approach here?
> I receive a request and pass that request to the scxml
> engine by means of triggering the proper event. The
> event then put the FSM in an action state where some
> internal methods (custom actions) are called.
> How could I just suspend the whole execution of the
> trigger and go back to the state the application was
> before receiving the external event? Right now if an
> exception is thrown from a custom action then a  new
> SCXMLExpressionException(e) is thrown as well so the
> FSM stops and therefore the FSM stops at the action
> state while of course I want it to go back to the
> original state.
> Thanks a lot,
> Nestor Urquiza
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message