Skip to content

Instantly share code, notes, and snippets.

@fabb fabb/gist:5014867
Last active Dec 14, 2015

What would you like to do?
Seemingly buggy behavior with PySCXML: the second event "f" is not received in most executions
import time
from scxml.pyscxml import StateMachine
import logging
logging.basicConfig(level=logging.NOTSET) # show detailed debug info
xml = '''
<scxml xmlns="" version="1.0" datamodel="python" initial="S1">
<state id="S1">
<log expr="'hello S1'"/>
<transition event="s2" target="S2">
<log expr="'transition s2 from S1 to S2'" />
<log expr="'bye S1'"/>
<state id="S2">
<log expr="'hello S2'"/>
<transition event="f" target="F">
<log expr="'transition f from S2 to F'" />
<log expr="'bye S2'"/>
<final id="F">
<log expr="'hello F'"/>
sm = StateMachine(xml)
#time.sleep(1) #problem does not occur when sleeping in between
sm.send("f") #event is ignored in most executions, statemachine stays in state S2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.