summaryrefslogtreecommitdiffstats
path: root/test/w3c/namespace/test406.scxml
blob: c8d9b1dd8b418ecc4401494b615289f8993871f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?xml version="1.0" encoding="UTF-8"?>
<!--  Test that states are entered in entry order (parents before children with document order used to break ties)
after the executable content in the transition is executed. event1, event2, event3, event4 should be raised in that 
order when the transition in s01 is taken  -->
<scxml:scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:conf="http://www.w3.org/2005/scxml-conformance" xmlns:scxml="http://www.w3.org/2005/07/scxml" version="1.0" initial="s0" datamodel="ecmascript">
  <scxml:state id="s0" initial="s01">
    <scxml:onentry>
      <scxml:send event="timeout" delay="1s"/>
    </scxml:onentry>
    <scxml:transition event="timeout" target="fail"/>
    <scxml:state id="s01">
      <scxml:transition target="s0p2">
        <!-- this should be the first event raised -->
        <scxml:raise event="event1"/>
      </scxml:transition>
    </scxml:state>
    <scxml:parallel id="s0p2">
      <scxml:transition event="event1" target="s03"/>
      <scxml:state id="s01p21">
        <scxml:onentry>
          <!-- third event -->
          <scxml:raise event="event3"/>
        </scxml:onentry>
      </scxml:state>
      <scxml:state id="s01p22">
        <scxml:onentry>
          <!-- the fourth event -->
          <scxml:raise event="event4"/>
        </scxml:onentry>
      </scxml:state>
      <scxml:onentry>
        <!-- this should be the second event raised -->
        <scxml:raise event="event2"/>
      </scxml:onentry>
    </scxml:parallel>
    <scxml:state id="s03">
      <scxml:transition event="event2" target="s04"/>
      <scxml:transition event="*" target="fail"/>
    </scxml:state>
    <scxml:state id="s04">
      <scxml:transition event="event3" target="s05"/>
      <scxml:transition event="*" target="fail"/>
    </scxml:state>
    <scxml:state id="s05">
      <scxml:transition event="event4" target="pass"/>
      <scxml:transition event="*" target="fail"/>
    </scxml:state>
  </scxml:state>
  <!-- end s0 -->
  <scxml:final id="pass">
    <scxml:onentry>
      <scxml:log label="Outcome" expr="'pass'"/>
    </scxml:onentry>
  </scxml:final>
  <scxml:final id="fail">
    <scxml:onentry>
      <scxml:log label="Outcome" expr="'fail'"/>
    </scxml:onentry>
  </scxml:final>
</scxml:scxml>