commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rahul Akolkar" <rahul.akol...@gmail.com>
Subject Re: [SCXML] EntryLlistener called after executing OnEntry Actions
Date Thu, 07 Dec 2006 16:12:57 GMT
On 12/7/06, Madhwaraj Rao <madhwaraj_rao@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


Mime
View raw message