This repository has been archived by the owner on Sep 25, 2018. It is now read-only.
/
TestInPredicate.scxml
114 lines (89 loc) · 2.58 KB
/
TestInPredicate.scxml
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<?xml version="1.0" encoding="UTF-8"?>
<!--
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
-->
<!--
This is to test the use of the In() predicate.
-->
<scxml
xmlns="http://www.w3.org/2005/07/scxml"
version="1.0"
name="root">
<initial>
<transition target="p1"/>
</initial>
<parallel id="p1">
<state id="r1" initial="a1">
<!-- sanity tests -->
<state id="a1">
<transition event="t1" target="b1" cond="In('a1')"/>
</state>
<state id="b1">
<transition event="t2" target="c1" cond="In('r1')"/>
</state>
<state id="c1">
<transition event="t3" target="d1" cond="In('p1')"/>
</state>
<!-- tests for failure -->
<state id="d1">
<transition event="t4" target="e1" cond="!In('e2')"/>
</state>
<state id="e1">
<transition event="t5" target="f1" cond="!In('c2')"/>
</state>
<!-- tests for success -->
<state id="f1">
<transition event="t6" target="g1" cond="In('a2')">
<raise event="gen1"/>
</transition>
</state>
<state id="g1">
<transition event="t7" target="h1" cond="In('b2')">
<raise event="gen2"/>
</transition>
</state>
<state id="h1">
<transition event="t8" target="i1" cond="In('c2')"/>
</state>
<state id="i1">
<transition event="t9" target="j1" cond="In('d2')">
<raise event="gen3"/>
</transition>
</state>
<state id="j1">
<transition event="t10" target="k1" cond="In('e2')"/>
</state>
<state id="k1"/>
</state>
<state id="r2" initial="a2">
<state id="a2">
<transition event="gen1" target="b2"/>
</state>
<state id="b2">
<transition event="gen2" target="c2"/>
</state>
<state id="c2">
<initial>
<transition target="d2"/>
</initial>
<state id="d2">
<transition event="gen3" target="e2"/>
</state>
<state id="e2"/>
</state>
</state>
</parallel>
</scxml>