summaryrefslogtreecommitdiffstats
path: root/tests/auto/statemachine/multipleinvokableservices.scxml
blob: 8b206954dbd105285764b9a97633891a2edc8444 (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
<?xml version="1.0" encoding="UTF-8"?>
<scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0" binding="early" name="MultipleInvokableServices.scxml" datamodel="ecmascript" initial="TopState">
    <datamodel>
        <data id="Var"/>
    </datamodel>
    <state id="TopState">
        <state id="State1">
            <invoke id="invoke1">
                <content>
                    <scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0" binding="early" name="anywhere">
                        <state id="foo">
                            <onentry>
                                <send target="#_parent" event="running1"/>
                            </onentry>
                            <transition event="toChild">
                                <send target="#_parent" event="received1"/>
                            </transition>
                        </state>
                    </scxml>
                </content>
            </invoke>
        </state>
        <state id="State2">
            <invoke id="invoke2">
                <content>
                    <scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0" binding="early" name="anywhere">
                        <state id="foo">
                            <onentry>
                                <send target="#_parent" event="running2"/>
                            </onentry>
                        </state>
                    </scxml>
                </content>
            </invoke>
        </state>
        <transition event="running1">
            <send event="toChild" target="#_invoke1"/>
        </transition>
        <transition event="received1">
            <assign location="Var" expr="1"/>
            <send event="toChild" target="#_invoke2"/>
        </transition>
        <transition event="error.communication" cond="Var == 1" target="success"/>
        <transition event="*" target="failure"/>
    </state>
    <final id="success"/>
    <final id="failure"/>
</scxml>