Skip to content
Ovan Crone edited this page Dec 14, 2017 · 9 revisions

Synopsis

REstate is a portable state-flow system. It allows you to define a set of possible states and what input will cause the transition between any two states. Additionally, when it transitions into a given state, you can define an action that will execute arbitrary code.

Glossary

  • State - A state is a value that represents a unique condition that the system is in at a given time.
  • Input - A value that signals a significant event that the system may act upon.
  • Transition - The act of moving between states in response to an input.
  • Guard - A precondition that must be satisfied for a transition to complete.
  • OnEntry - An action that can perform arbitrary operations when a particular state has been transitioned into.
  • Schematic - A schematic is the definition of a state-flow which contains a set of states and their transitions, OnEntryActions, and Guards as well as the initial state of the system.
  • Machine - An instance of a schematic that maintains state and can be interacted with by sending input.
  • Connector - A class that implements either IEntryConnector or IGuardianConnector, to provide either OnEntry or Guard capabilities respectively, to schematics and machines.
  • EventListener - A class that will be notified when a machine is created, a transition occurs, or a machine is deleted.
  • Repository - A class that provides the machine state and schematic storage.
  • Agent/Host - The entry-points for REstate to expose all other functionality. A REstate Host and Agent can and will likely be used interchangeably in conversation and documentation.

How is it portable

REstate maintains portability by keeping the definitions serializable and referencing connectors, which provide the actions for the state, by name rather than a direct C# reference to a Lambda or similar construct. This means a REstate Machine can execute anywhere, as long as all systems that intend to execute the code have the connectors as well. This can be done by all agents using the same repository, or by utilizing the REstate.Remote plugin.