You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Madhwaraj Rao <ma...@yahoo.com> on 2006/12/07 08:18:29 UTC

[SCXML] EntryLlistener called after executing OnEntry Actions

Hi,

I have a requirement that the registered EntryListener
gets called before any OnEntry Actions are executed on
entering a state.
Currently, the default semantics
(SCXMLSemanticsImpl)does the following in its
executeActions() method:
-  executes each OnEntry Action for this transition
target
-  calls NotificationRegistry.fireOnEntry()

I would like to be notified of a state transition
before any OnEntry Actions are executed. Ideally I
want the EntryListener.onEntry() to be invoked first
on a state transition.
Is there a way I can achieve this? This is an
important requirement for me. 

Thanks
--
Raj


 
____________________________________________________________________________________
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail.yahoo.com

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


Re: [SCXML] EntryLlistener called after executing OnEntry Actions

Posted by Rahul Akolkar <ra...@gmail.com>.
On 12/7/06, Madhwaraj Rao <ma...@yahoo.com> wrote:
> Hi,
>
> I have a requirement that the registered EntryListener
> gets called before any OnEntry Actions are executed on
> entering a state.
> Currently, the default semantics
> (SCXMLSemanticsImpl)does the following in its
> executeActions() method:
> -  executes each OnEntry Action for this transition
> target
> -  calls NotificationRegistry.fireOnEntry()
>
> I would like to be notified of a state transition
> before any OnEntry Actions are executed. Ideally I
> want the EntryListener.onEntry() to be invoked first
> on a state transition.
> Is there a way I can achieve this? This is an
> important requirement for me.
>
<snip/>

The listeners in Commons SCXML are part of the implementation perks
(there is nothing in the W3C draft that requires listeners -- though
they are useful to be in any impl IMO). As a result, there is no
oracle that dictates when these should be fired. I can see sensible
arguments either way, and so the incumbent must prevail.

For scenarios where it is mission critical to change this behavior (as
you suggest) there is the option of providing your own SCXMLSemantics
impl. The default impl which you quote above can be subclassed (as
you're aware its sort of coarse-grained, but that will have to do).

Suggestion:

 * Author a MySemanticsImpl that extends SCXMLSemanticsImpl

 * Provide an implementation for the executeActions() method (pretty
much identical to superclass but change the order to get the onentries
to fire as you expect)

 * Point to MySemanticsImpl while instantiating executor instances
using the 4 argument constructor (the one that takes a SCXMLSemantics
impl as a constructor argument)

-Rahul


> Thanks
> --
> Raj
>
>
>

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