Skip to content
Ovan Crone edited this page Dec 17, 2017 · 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.
  • 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 - Contain almost all functionality for REstate, an agent determines where functionality is executed. (the local or a remote server if using REstate.Remote) the default Agent (REstateHost.Agent) is equivalent to REstateHost.Agent.AsLocal(), but can be configured to be REstateHost.Agent.AsRemote() with the REstate.Remote package.
  • REstateHost - The entry-point for REstate to expose agents. A REstate Host is the application from which the code is being called.

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.