-
Notifications
You must be signed in to change notification settings - Fork 44
Using Flux
Flux provides the following primitives in order to model any State Machine
StateMachine : This is comprised of a set of states.
State: A state depicts a point in time for the user. A state has a Task associated with it that would be executed once the state machine enters that state.
Task: A task defines a unit of work that needs to be executed. A task is dependent on zero or more ‘Events’. A task can also raise an event upon successful completion.
Event: We model the transition table of an arbitrary state machine by the notion of events. A successful execution of a task can raise an Event. Each raised event can trigger a transition to another state
Hooks: Hooks are add-ons that can be used to perform a task upon entry in or exit from a state. They do not raise an event and thus do not alter the flow of transitions of the state machine.
In the subsequent examples we demonstrate some real life use cases to model State Machines or Advanced workflows using Flux