Skip to content
Ovan Crone edited this page Apr 11, 2018 · 9 revisions

Synopsis

REstate is a portable state-flow system. It allows you to define a set of possible states that a program can exist in and what input will cause the transition between any two states. When it transitions into a given state, you can define an action that will execute arbitrary code. This can be used to build complex, but deterministic and predefined systems, such as workflow systems or distributed systems.

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, the language of the Machine.
  • Transition - The act of moving between states in response to an input.
  • Precondition - A condition that must be satisfied for a transition to be attempted.
  • Action - An action that can perform arbitrary operations when a particular state has been transitioned into.
  • Schematic - The definition of a state-flow which contains a set of states and their transitions, Actions, and Preconditions 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 IAction or IPrecondition, to provide either Action or Precondition 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.

Portability

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.