commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rahul Akolkar <>
Subject Re: [SCXML] Exposing data model to SCXMLListener
Date Sun, 22 Mar 2009 17:25:57 GMT
On Fri, Mar 20, 2009 at 5:07 PM, Alexei Samonov
<> wrote:
> Hi,
> What is the recommended API for reading FSM's data model from outside of
> FSM?

There are multiple ways (depending on the specifics of the usecase),
but perhaps the simplest is to use <send> with the namelist specifying
the parts of the data model that are needed "outside". Use a custom
@targettype and supply a corresponding EventDispatcher implementation
to the SCXMLExecutor.

> For example, I want to read some nodes from the datamodel when I receive
> a state change event in SCXMLListener.
> I tried accessing it by
> executor.getSCInstance().getRootContext().getVars() to get the data
> model's DOM tree but I do not see it populated with the actual current
> values.

Having said that, specifically regarding the above usage:

 * If you are looking for the root <datamodel> (child of <scxml>)
values, then you will find the current values in the variable map
obtained above, keyed by the <data> @name.
 * The state chart instance isn't exposed so I suspect you mean
executor.getRootContext() in the statement above


> Regards,
> Alexei

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

View raw message