commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rahul Akolkar" <>
Subject Re: SCXML
Date Fri, 28 Dec 2007 19:12:04 GMT
On 12/28/07, Lupu Slobodu <> wrote:
> Is there a chance to know at the parsing time what state is a (custom)
> action going to run in? This could be useful if one wants to initialize and
> validate an action handler registry that would associate action handlers to
> particular states.

Without going to the architectural necessity for such introspection
(it may be good to do without it, if possible), the state in which a
custom action is being executed at run-time is the parent of the
Executable container in which it resides i.e. given ...

  <state id="foo">
          <my:bar .../>

where <my:bar> is implemented by a custom action whose execute()
method contains (untested):

  String id = getParent().getParent().getId();

then the value of id for the execution above would be "foo".


> While it is possible to determine the current sate at run time and
> dynamically instantiate the handlers( as the AbstractStateMachine does),
> this approach  leaves room for potential inconsistencies (as a handler class
> could not be defined)

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

View raw message