summaryrefslogtreecommitdiffstats
path: root/test/w3c/lua/test354.scxml
blob: 4acecf3ac6333d4792bca5af2303705b8a9938e5 (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
<?xml version="1.0" standalone="no"?>
<!-- test that event.data can be populated using both namelist, param and <content>
and that correct values are used -->
<scxml xmlns="http://www.w3.org/2005/07/scxml" initial="s0" version="1.0" datamodel="lua">
  <datamodel>
    <data expr="1" id="testvar1"/>
    <data id="testvar2"/>
    <data id="testvar3"/>
  </datamodel>
  <state id="s0">
    <onentry>
      <send delay="5s" event="timeout"/>
      <send event="event1" type="http://www.w3.org/TR/scxml/#SCXMLEventProcessor" namelist="testvar1">
        <param name="param1" expr="2"/>
      </send>
    </onentry>
    <transition event="event1" target="s1">
      <assign expr="_event.data.testvar1" location="testvar2"/>
      <assign expr="_event.data.param1" location="testvar3"/>
    </transition>
    <transition event="*" target="fail">
    </transition>
  </state>
  <state id="s1">
    <transition target="s2" cond="testvar2 == 1"/>
    <transition target="fail"/>
  </state>
  <state id="s2">
    <transition target="s3" cond="testvar3 == 2"/>
    <transition target="fail"/>
  </state>
  <state id="s3">
    <onentry>
      <send delay="5s" event="timeout"/>
      <send event="event2">
        <content>foo</content>
      </send>
    </onentry>
    <transition event="event2" cond="_event.data == 'foo'" target="pass"/>
    <transition event="*" target="fail"/>
  </state>
  <final id="pass"/>
  <final id="fail"/>
</scxml>