On 12/7/06, Madhwaraj Rao <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to