<?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 
    datamodel="ecmascript"
    xmlns="http://www.w3.org/2005/07/scxml"
    initial="p1"
    version="1.0">

    <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>



