- Harlowja (until further notice).
- Praneshp (@yahoo)
The goal of this library would be to provide a well documented state machine classes/utilities that start off with the a basic set and can expand into a larger set as time goes on. The state machine pattern (or the implemented variation there-of) is a commonly used pattern and has a multitude of various usages.
Some of the current usages for it (that are being actively pursued):
The code for this library was extracted from taskflow and has been copied into ironic and appears to be a key part of that projects states work where it is now serving a useful purpose there; so I would consider the API mostly stable (ironic is not currently using the FSM runner properties while taskflow would be/is). The code/mini-library was recently split off into https://github.com/harlowja/automaton where it has been developed and isolated (the tests extracted for example, a setup.py added and pbr integrated...) and it has travis-ci running against it for testing integration (this would no longer be needed as the openstackci serves a similar/equivalent purpose).
For those wondering what a hierarchical state machine is the following can be referred to about it (the concepts are similar to what is described in the following slide-set).
Currently the machine public API is the following:
FiniteMachine - runner (read-only property) - default_start_state (read/write property) - current_state (read-only property) - terminated (read-only property) - add_state(state, terminal=False, on_enter=None, on_exit=None) - add_reaction(state, event, reaction, *args, **kwargs) - add_transition(start, end, event) - process_event(event) -- main function/method!! - initialize(start_state=None) - copy(shallow=False, unfreeze=False) - freeze() - frozen (read/write property) - states (read-only property) - events (read-only property) - pformat(sort=True, empty='.') HierarchicalFiniteMachine(FiniteMachine) - runner (read-only property) - add_state(state, terminal=False, on_enter=None, on_exit=None, machine=None)
The runners of each state machine have the following public API:
Further API documentation (that is likely more readable and better commented) can be found at:
Or from the live taskflow docs (that are using a slightly older version of the machines, minus a couple API adjustments; nothing major changed though):
Security Contact: harlowja
Target Milestone for completion: liberty-1
All of the currently planned dependencies are in the requirements repository.
This work is licensed under a Creative Commons Attribution 3.0 Unported License. http://creativecommons.org/licenses/by/3.0/legalcode