jbeard4 / SCION

SCXML/Statecharts in JavaScript, moved to gitlab: https://gitlab.com/scion-scxml/scion
https://scion.scxml.io
Apache License 2.0
149 stars 29 forks source link

Errors in the execution of a state machine #362

Open aldahirSealtiel opened 8 years ago

aldahirSealtiel commented 8 years ago

Good day, I wonder if you can help me with a problem I have. I try to run a state machine created in XML with SCION.

This is the code of state machine: captura de pantalla de 2015-09-28 09 55 13

I'm sorry but I could not upload the code. i don't know why.

I tried to execute the state machine the following way:

<html>
    <head>
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
        <script src="http://cdnjs.cloudflare.com/ajax/libs/es5-shim/1.2.4/es5-shim.min.js"></script>
        <script type="text/javascript" src="http://jbeard4.github.com/SCION/builds/latest/scion-min.js"></script>
        <script>
            var scion = require('scion');

            $(document).ready(function(){
                var rect = document.getElementById("rect");

                scion.urlToModel("maquina1.xml",function(err,model){

                    if(err) throw err;

                    //instantiate the interpreter
                    var interpreter = new scion.SCXML(model);

                    //start the interpreter
                    interpreter.start();
            });
            });
        </script>
    </head>
    <body>
    </body>
</html>

It does not work, I throw These errors. I hope you can help me, thanks!

Failed to evaluate action factory. scion-min.js:1 Generated js code to evaluate function($log,$cancel,$send,$origin,In,require,$parseXml,_sessionid,_ioprocessors,_x){ function i(a){return a?a.slice(-2)==="ms"?parseFloat(a.slice(0,-2)):a.slice(-1)==="s"?parseFloat(a.slice(0,-1))*1e3:parseFloat(a):0} var $datamodel = {

}; return { datamodel:$datamodel, actions:[ function(getData,setData,_events,$raise){var _event = _events[0]; $log(ready); }, function(getData,setData,_events,$raise){var _event = _events[0]; $log(ready to running); }, function(getData,setData,_events,$raise){var _event = _events[0]; $log(running); }, function(getData,setData,_events,$raise){var _event = _events[0]; $log(running to paused); }, function(getData,setData,_events,$raise){var _event = _events[0]; $log(running to stopped); }, function(getData,setData,_events,$raise){var _event = _events[0]; $log(paused); }, function(getData,setData,_events,$raise){var _event = _events[0]; $log(paused to running); }, function(getData,setData,_events,$raise){var _event = _events[0]; $log(paused to stopped); }, function(getData,setData,_events,$raise){var _event = _events[0]; $log(stopped); }, function(getData,setData,_events,$raise){var _event = _events[0]; $log(stopped to ready); } ] }; }