commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rahul Akolkar" <>
Subject Re: [scxml] adding an xml to the datamodel
Date Fri, 28 Apr 2006 21:04:50 GMT
On 4/28/06, Nestor Urquiza <> wrote:
> Hello guys,
> Here I am trying to include my external xml file into
> the model using the snippet posted by Fasih:
> //byteArraySettingsFileContent has the external xml
> file content
> Data scenarioData = new Data();
> //I need to understand how to set a node here with the
> content of the above file.

I have only glanced at this thread, maybe I missed something. You can
obtain the org.w3.dom.Node instance whatever way you want and place it
in the root context to achieve the same effect you're trying below. It
doesn't have to be a <data> element (or Data class, if procedurally

The expression language evaluator doesn't know, nor does it care,
where the "variable" came from -- whether it was a <var> / Var or
<data> / Data or Context#setLocal() / set(), its all the same to the
expression language.

Ofcourse, I need to write the data model section to the user guide so
this is public knowledge. I'm out this weekend, if you want to post a
ticket in bugzilla, it will be guaranteed to stay on our radar.

There is one subtle difference between <var> and <data> with respect
to the way an SCXMLExecutor instance resets itself.

 * <var>s being "scratch space" are deleted / lost on reset
(Context#setLocal() / set() behaves the same way)

 * <data>s being part of the first class data model defined for a
state, get reset to their initial value

But, the reset functionality is probably rarely used (and should be
used with quite a bit of caution).


> /* The Fasih sippet was for setting up String
> variables:
> scenarioData.setName(Constants.SCENARIO_ID_PARAM);
> scenarioData.setExpr("the content of the var here");
> scxml.setDatamodel(new Datamodel());
> scxml.getDatamodel().addData(scenarioData);
> Thanks you all,
> Nestor

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

View raw message