You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Tobias Salzbrunn <to...@web.de> on 2008/02/26 11:55:08 UTC
SCXML initial state for orthogonal state
Hello all,
I am new to SCXML and first tried to run a general example for a parallel state:
<?xml version="1.0" encoding="windows-1250"?>
<scxml xmlns="http://www.w3.org/2005/07/scxml"
version="1.0"
initialstate="mainState">
<state id="mainState">
<parallel id="parts">
<state id="region1">
<initial>
<transition target="state1"/>
</initial>
<state id="state1">
<transition event="t1" target="state2"/>
</state>
<state id="state2">
<transition event="t2" target="state1"/>
</state>
</state>
<state id="region2">
<initial>
<transition target="state3"/>
</initial>
<state id="state3">
<transition event="t1" target="state4"/>
</state>
<state id="state4">
<transition event="t3" target="state3"/>
</state>
</state>
</parallel>
</state>
</scxml>
running the resp. java programm yields to following error-log:
org.apache.commons.scxml.io.ModelUpdater logAndThrowModelError
SCHWERWIEGEND: No initial element available for state with ID "mainState"
IMHO the "mainState" does not need to have an initial element, because the
substates have initial elements.
Any comments?
Thanks in advance
Tobias
_______________________________________________________________________
Jetzt neu! Schützen Sie Ihren PC mit McAfee und WEB.DE. 30 Tage
kostenlos testen. http://www.pc-sicherheit.web.de/startseite/?mc=022220
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org
Re: SCXML initial state for orthogonal state
Posted by Rahul Akolkar <ra...@gmail.com>.
On 2/26/08, Tobias Salzbrunn <to...@web.de> wrote:
> Hello all,
> I am new to SCXML and first tried to run a general example for a parallel state:
>
> <?xml version="1.0" encoding="windows-1250"?>
> <scxml xmlns="http://www.w3.org/2005/07/scxml"
> version="1.0"
> initialstate="mainState">
>
> <state id="mainState">
> <parallel id="parts">
> <state id="region1">
> <initial>
> <transition target="state1"/>
> </initial>
> <state id="state1">
> <transition event="t1" target="state2"/>
> </state>
> <state id="state2">
> <transition event="t2" target="state1"/>
> </state>
> </state>
> <state id="region2">
> <initial>
> <transition target="state3"/>
> </initial>
> <state id="state3">
> <transition event="t1" target="state4"/>
> </state>
> <state id="state4">
> <transition event="t3" target="state3"/>
> </state>
> </state>
> </parallel>
> </state>
> </scxml>
>
>
> running the resp. java programm yields to following error-log:
>
> org.apache.commons.scxml.io.ModelUpdater logAndThrowModelError
> SCHWERWIEGEND: No initial element available for state with ID "mainState"
>
> IMHO the "mainState" does not need to have an initial element, because the
> substates have initial elements.
>
> Any comments?
>
<snip/>
Based on the question, I'm assuming use of the new parser (SCXMLParser class).
An <initial> is needed (alternatively, there is no need for the
"mainState" <state> wrapper around the <parallel>).
See, for example, these two tests that show both flavors (long,
possibly fragmented URLs below):
http://svn.apache.org/repos/asf/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/env/jexl/microwave-04.xml
http://svn.apache.org/repos/asf/commons/proper/scxml/trunk/src/test/java/org/apache/commons/scxml/env/jexl/microwave-05.xml
Also note that there is a bug in the SCXMLParser in v0.7 (fixed in
trunk) that affects the processing of <parallel>s. See:
http://issues.apache.org/jira/browse/SCXML-67
-Rahul
> Thanks in advance
>
> Tobias
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org