blob: ebd9acf1a2cc6d467ac7f6b65e673a44cdde5423 (
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
61
62
63
64
65
66
67
68
69
|
<?xml version="1.0" encoding="UTF-8"?>
<!-- test that only finalize markup in the invoking state runs. the first invoked process will
return 2 in _event.data.aParam, while second invoked process sleeps without returning any events.
Only the first finalize should execute. So when we get to s1 var1 should have value 2 but
var2 should still be set to 1 -->
<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="p0" version="1.0" datamodel="ecmascript">
<scxml:datamodel>
<scxml:data id="Var1" expr="1"/>
<scxml:data id="Var2" expr="1"/>
</scxml:datamodel>
<scxml:parallel id="p0">
<scxml:onentry>
<scxml:send event="timeout" delay="3s"/>
</scxml:onentry>
<scxml:transition event="timeout" target="fail"/>
<scxml:state id="p01">
<scxml:invoke type="http://www.w3.org/TR/scxml/">
<scxml:content>
<scxml:scxml version="1.0" initial="subFinal1" datamodel="ecmascript">
<scxml:final id="subFinal1">
<scxml:onentry>
<scxml:send target="#_parent" event="childToParent">
<scxml:param name="aParam" expr="2"/>
</scxml:send>
</scxml:onentry>
</scxml:final>
</scxml:scxml>
</scxml:content>
<scxml:finalize>
<scxml:assign location="Var1" expr="_event.data.aParam"/>
</scxml:finalize>
</scxml:invoke>
<scxml:transition event="childToParent" cond="Var1==2" target="s1"/>
<scxml:transition event="childToParent" target="fail"/>
</scxml:state>
<scxml:state id="p02">
<scxml:invoke type="http://www.w3.org/TR/scxml/">
<scxml:content>
<scxml:scxml version="1.0" initial="sub0" datamodel="ecmascript">
<scxml:state id="sub0">
<scxml:onentry>
<scxml:send event="timeout" delay="2s"/>
</scxml:onentry>
<scxml:transition event="timeout" target="subFinal2"/>
</scxml:state>
<scxml:final id="subFinal2"/>
</scxml:scxml>
</scxml:content>
<scxml:finalize>
<scxml:assign location="Var2" expr="_event.data.aParam"/>
</scxml:finalize>
</scxml:invoke>
</scxml:state>
</scxml:parallel>
<scxml:state id="s1">
<scxml:transition cond="Var2==1" 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>
|