summaryrefslogtreecommitdiffstats
path: root/test/w3c/lua/test190.scxml
blob: 09ad2689f09f4fa1a684df80ac980cba74f7c9b1 (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" standalone="no"?>
<!-- we test that #_scxml_sessionid as a target of <send> puts the event on the external queue.  If it does,
event1 will be processed before event2, because event1 is added to the internal queue while event2 is
added to the external queue (event though event2 is generated first).  we have to make sure that event2
is actually delivered.  The delayed <send> makes sure another event is generated (so the test doesn't hang) -->
<scxml xmlns="http://www.w3.org/2005/07/scxml" initial="s0" version="1.0" datamodel="lua">
  <datamodel>
    <data expr="'#_scxml_'" id="testvar1"/>
    <data expr="_sessionid" id="testvar2"/>
  </datamodel>
  <state id="s0">
    <onentry>
      <assign location="testvar1" expr="testvar1..testvar2"/>
      <!-- goes to the external queue -->
      <send event="event2" targetexpr="testvar1"/>
      <!-- to the internal queue -->
      <raise event="event1"/>
      <!-- this should get added to the external queue after event2 -->
      <send event="timeout"/>
    </onentry>
    <!-- once we've entered the state, we should check for internal events first -->
    <transition event="event1" target="s1"/>
    <transition event="*" target="fail"/>
  </state>
  <!-- now check that we get event2 and not a timeout -->
  <state id="s1">
    <transition event="event2" target="pass"/>
    <transition event="*" target="fail"/>
  </state>
  <final id="pass"/>
  <final id="fail"/>
</scxml>