State Machine
7 nodes
On this page 7
Make State Machine
FunctionThis node carries no documentation.
StateMachineApplication() -> State Machine
StateMachineApplication StateMachineApplication()
Returns
| State Machine | State Machine |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- State Machine
- Package
- State Machines
Add Transition
FunctionDeclares one transition. A null Condition is an UNCONDITIONAL transition: it is
satisfied on every evaluation, so the machine leaves From State after its next
Update returns (subject to priority - an unconditional low-priority transition is a fallback edge).
That is the recorded phase-3 decision for a transition whose payload names no condition graph: an
edge the author drew means something, and "always" is the natural meaning of an unguarded one.
AddTransition
State Machine: State Machine
fromState: Text
toState: Text
transitionName: Text
condition: Func<Truth>
priority: Integervoid AddTransition(
StateMachineApplication State Machine,
string fromState,
string toState,
string transitionName,
Func<bool> condition,
int priority)Parameters
| name | type | default | description |
|---|---|---|---|
| State Machine | State Machine | — | |
| fromState | Text | — | The state this transition leaves. |
| toState | Text | — | The state this transition enters (may equal From State - a self-transition). |
| transitionName | Text | — | The authored display name, or null for an unnamed transition. |
| condition | Func<Truth> | — | Whether the transition fires, asked after each Update; null = always. |
| priority | Integer | — | Higher evaluates first; see StateMachineApplication.OutgoingOf for the tie rule. |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- State Machine
- Package
- State Machines
Machine Name
FunctionWhat failure messages call this machine: the graph's name interpreted, set by the emitted
constructor compiled; the emitted type's name failing both.
MachineName(State Machine: State Machine) -> Text
string MachineName(StateMachineApplication State Machine)
Parameters
| name | type | default | description |
|---|---|---|---|
| State Machine | State Machine | — |
Returns
| result | Text |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- State Machine
- Package
- State Machines
Stop Requested
FunctionWhether StateMachineApplication.Stop has been called for the current run.
StopRequested(State Machine: State Machine) -> Truth
bool StopRequested(StateMachineApplication State Machine)
Parameters
| name | type | default | description |
|---|---|---|---|
| State Machine | State Machine | — |
Returns
| result | Truth |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- State Machine
- Package
- State Machines
Tick Scheduler
FunctionThe tick scheduler the loop runs on; null (the default) means real time
(StateMachine.RealTimeTickScheduler). Settable so a test - or any host that owns time - can drive
the machine deterministically; this is the machine analogue of the recording-driver pattern.
TickScheduler(State Machine: State Machine) -> I State Machine Tick Scheduler
IStateMachineTickScheduler TickScheduler(StateMachineApplication State Machine)
Parameters
| name | type | default | description |
|---|---|---|---|
| State Machine | State Machine | — |
Returns
| result | I State Machine Tick Scheduler |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- State Machine
- Package
- State Machines
Register State
FunctionDeclares one state: its name (the state graph's name), how to construct a FRESH instance of it -
entering a state always constructs anew, self-transitions included - and whether it is the initial
state.
RegisterState
State Machine: State Machine
stateName: Text
factory: Func<State Machine State>
isInitial: Truthvoid RegisterState(
StateMachineApplication State Machine,
string stateName,
Func<StateMachineState> factory,
bool isInitial = false)Parameters
| name | type | default | description |
|---|---|---|---|
| State Machine | State Machine | — | |
| stateName | Text | — | |
| factory | Func<State Machine State> | — | |
| isInitial | Truth | False |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- State Machine
- Package
- State Machines
Stop
FunctionEnds the machine from anywhere: the loop stops at its next checkpoint - after the callback (or
condition) that called this returns - without exiting the active state. Callable from a state
(through StateMachineState.Stop), from a condition, or from another thread.
Stop(State Machine: State Machine)
void Stop(StateMachineApplication State Machine)
Parameters
| name | type | default | description |
|---|---|---|---|
| State Machine | State Machine | — |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- State Machine
- Package
- State Machines