commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fasih" <fasihullah.ask...@baypackets.com>
Subject Re: [scxml] Handling exceptions thrown by custom actions
Date Tue, 16 May 2006 04:08:29 GMT
Hi
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.

+Fasih
----- Original Message ----- 
From: "Nestor Urquiza" <nestoru@yahoo.com>
To: "Jakarta Commons Users List" <commons-user@jakarta.apache.org>
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
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
> 




---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message