On Fri, Mar 20, 2009 at 5:07 PM, Alexei Samonov <[email protected]> wrote: > Hi, > > > > What is the recommended API for reading FSM's data model from outside of > FSM? > <snip/>
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. > <snap/> 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 -Rahul > > > Regards, > > Alexei > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
