Skip to content

Instantly share code, notes, and snippets.

@harlowja
Created July 12, 2014 03:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save harlowja/d5c536de8d8f72377760 to your computer and use it in GitHub Desktop.
Save harlowja/d5c536de8d8f72377760 to your computer and use it in GitHub Desktop.
from taskflow.types import fsm
from taskflow import states as st
m = fsm.FSM(st.UNDEFINED)
m.add_state(st.UNDEFINED)
m.add_state(st.RESUMING)
m.add_state(st.REVERTED)
m.add_state(st.SCHEDULING)
m.add_state(st.SUCCESS)
m.add_state(st.SUSPENDED)
m.add_state(st.WAITING)
m.add_state(st.ANALYZING)
m.add_transition(st.UNDEFINED, st.RESUMING, 'start', None, None)
m.reset()
print(m.pformat())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment