summaryrefslogtreecommitdiffstats
path: root/test/w3c/namespace/test318.scxml
blob: a181bfd477bf6c1f3cb09b47293d9ef3c66badd9 (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
<?xml version="1.0" encoding="UTF-8"?>
<!-- test that _event stays bound during the onexit and entry into the next state -->
<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" initial="s0" version="1.0" datamodel="ecmascript" name="machineName">
  <scxml:datamodel>
    <scxml:data id="Var1"/>
  </scxml:datamodel>
  <scxml:state id="s0">
    <scxml:onentry>
      <scxml:raise event="foo"/>
    </scxml:onentry>
    <scxml:transition event="foo" target="s1"/>
  </scxml:state>
  <scxml:state id="s1">
    <scxml:onentry>
      <scxml:raise event="bar"/>
      <!-- _event should still be bound to 'foo' at this point -->
      <scxml:assign location="Var1" expr="_event.name"/>
    </scxml:onentry>
    <scxml:transition cond="Var1=='foo'" target="pass"/>
    <scxml:transition target="fail"/>
  </scxml:state>
  <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>