Closed mattoshry closed 9 years ago
The issue is in the model initialization code in SCION-CORE here https://github.com/jbeard4/SCION-CORE/blob/master/lib/scion.js#L187 Which assumes that the initial state will be a substate. This is an erroneous assumption.
The solution will be to hook the initial state logic into connectTransitionGraph: https://github.com/jbeard4/SCION-CORE/blob/master/lib/scion.js#L216
ETA Monday
Fixed in PR #335
<scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0" initial="s2">
<state id="uber"> <state id="s1"> <onentry> <log expr="'onentry s1 _sessionid=' + _sessionid" label="TEST"/> </onentry> <transition event="ev1" target="s2"/> </state>
<state id="s2"> <onentry> <log expr="'onentry s2 _sessionid=' + _sessionid" label="TEST"/> </onentry> </state> </state> </scxml>
Scion throws here: /Users/matto/git/scxml/node_modules/scxml/node_modules/scion-core/lib/scion.js:190 if(!state.initialRef) throw new Error('Unable to locate initia ^ Error: Unable to locate initial state for composite state: undefined