blob: 9550c39d1957ec3bbd09fb03e2353c2164d7370d (
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
|
<?xml version="1.0" encoding="UTF-8"?>
<!-- test that that any content in the message other than _scxmleventname is used to populate
_event.data. -->
<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" datamodel="ecmascript" version="1.0">
<scxml:datamodel>
<scxml:data id="Var1" expr="2"/>
</scxml:datamodel>
<scxml:state id="s0">
<scxml:onentry>
<scxml:send event="timeout" delay="3s"/>
<!-- in this case, 'test' will be placed in _scxmleventname. The <param> should
be used to populate _event.data -->
<scxml:send event="test" targetexpr="_ioprocessors['basichttp']['location']" type="http://www.w3.org/TR/scxml/#BasicHTTPEventProcessor">
<scxml:param name="param1" expr="2"/>
</scxml:send>
</scxml:onentry>
<!-- if we get this event, we succeed -->
<scxml:transition event="test" target="s1">
<scxml:assign location="Var1" expr="_event.data.param1"/>
</scxml:transition>
<scxml:transition event="*" target="fail"/>
</scxml:state>
<scxml:state id="s1">
<scxml:transition cond="Var1==2" 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>
|