<?xml version="1.0" encoding="UTF-8"?>
<diagram author="Yentl Van Tendeloo" name="Logging">
    <description>
        For testing: send 2 values and wait for the sum
    </description>

    <inport name="inp"/>
    <outport name="outp"/>

    <class name="Exec_MT" default="true">
        <scxml initial="init">
            <state id="init">
                <transition event="input" cond="value == 'init'" port="inp" target=".">
                    <parameter name="value"/>
                    <raise event="output" port="outp" scope="output">
                        <parameter expr="2"/>
                    </raise>
                    <raise event="output" port="outp" scope="output">
                        <parameter expr="3"/>
                    </raise>
                    <script>
                        print("RAISE EVENT ON PORT")
                    </script>
                </transition>

                <transition event="input" cond="type(value) == int" port="inp" target=".">
                    <parameter name="value"/>
                    <script>
                        print("Got: " + str(value))
                    </script>
                </transition>

                <transition after="30" target="../finished">
                    print("ERROR")
                </transition>

                <transition event="terminate" port="inp" target="../finished">
                    <script>
                        print("Got terminate")
                    </script>
                </transition>
            </state>

            <state id="finished"/>
        </scxml>
    </class>
</diagram>
