On 2/26/08, Tobias Salzbrunn <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to