You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by ra...@apache.org on 2006/03/03 23:37:49 UTC

svn commit: r382950 - /jakarta/commons/sandbox/scxml/trunk/xdocs/guide/scxml-documents.xml

Author: rahul
Date: Fri Mar  3 14:37:48 2006
New Revision: 382950

URL: http://svn.apache.org/viewcvs?rev=382950&view=rev
Log:
Add section on parallelism in state charts.

A nice demonstration will be to use parallelism to execute multiple Shale dialogs (at the same time) -- another todo.

Modified:
    jakarta/commons/sandbox/scxml/trunk/xdocs/guide/scxml-documents.xml

Modified: jakarta/commons/sandbox/scxml/trunk/xdocs/guide/scxml-documents.xml
URL: http://svn.apache.org/viewcvs/jakarta/commons/sandbox/scxml/trunk/xdocs/guide/scxml-documents.xml?rev=382950&r1=382949&r2=382950&view=diff
==============================================================================
--- jakarta/commons/sandbox/scxml/trunk/xdocs/guide/scxml-documents.xml (original)
+++ jakarta/commons/sandbox/scxml/trunk/xdocs/guide/scxml-documents.xml Fri Mar  3 14:37:48 2006
@@ -200,6 +200,70 @@
 
   </section>
 
+  <section name="Parallel">
+
+   <p>This is a wrapper element that encapsulates multiple
+      &lt;state&gt;s -- or state machines, since in the section on
+      composite states we took a look at the "recursion" or
+      "nesting" for the &lt;state&gt; element, whereby each state
+      can become a state machine in its own right -- that are "active"
+      at the same time. Here is
+      a relevant snippet (the entire version of this
+      <a href="http://svn.apache.org/repos/asf/jakarta/commons/sandbox/scxml/trunk/src/test/java/org/apache/commons/scxml/env/jexl/microwave-02.xml">parallel microwave example</a>
+      ):</p>
+
+   <pre>
+    &lt;!--
+      ... begin snippet ...
+    --&gt;
+
+     &lt;state id="microwave"&gt;
+      &lt;parallel id="parts"&gt;
+       &lt;state id="oven"&gt;
+
+        &lt;!-- state machine for "oven" (idle/cooking) --&gt;
+
+       &lt;/state&gt;
+
+       &lt;state id="oven"&gt;
+
+        &lt;!-- state machine for "door" (open/closed) --&gt;
+
+       &lt;/state&gt;
+      &lt;/parallel&gt;
+     &lt;/state&gt;
+
+    &lt;!--
+      ... end snippet ...
+    --&gt;
+   </pre>
+
+   <p>
+    <ul>
+     <li>The state "microwave" is an example of a "orthogonal"
+         state (one that owns a parallel).</li>
+     <li>It contains two state machines, "oven" and "door". These
+         state machines are "active" at the same time. These are
+         known as "regions".
+     </li>
+     <li>Transition may occur within a region or from a region to
+         outside the &lt;parallel&gt; (see below), but never from
+         one region to another ("across" regions).
+     </li>
+     <li>There is no need for an &lt;initial&gt; element within
+         a &lt;parallel&gt;</li>
+     <li>The state machine must enter all regions at the same time,
+         and an outbound transition out of the &lt;parallel&gt;
+         from any region causes the state machine to exit all
+         regions.</li>
+     <li>When all regions reach a "final" state, an "id.done" event
+         is fired, where "id" is the id of the parent &lt;parallel&gt;
+         </li>
+    </ul>
+   </p>
+
+  </section>
+
   <section name="Hello World with a custom action">
 
    <p>The Commons SCXML implementation allows you to register custom actions.



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org