Options
All
  • Public
  • Public/Protected
  • All
Menu

  subscribe now with sterfive to access the online-user manual

Program Finite State Machine

as per part 10 : Program Specification

A standard set of base states is defined for Programs as part of the Program Finite State Machine. These states represent the stages in which a Program can exist at an instance in time as viewed by a Client. This state is the Program’s current state. All Programs shall support this base set. A Program may or may not require a Client action to cause the state to change. The states are formally defined in Table 2.

Table 2 – Program states | State | Description |-----------|-------------------------------------------------------------------------------------| | Ready | The Program is properly initialized and may be started. | | Running | The Program is executing making progress towards completion. | | Suspended | The Program has been stopped prior to reaching a terminal state but may be resumed. | | Halted | The Program is in a terminal or failed state, and it cannot be started or resumed without being reset|

The set of states defined to describe a Program can be expanded. Program sub states can be defined for the base states to provide more resolution of a process and to describe the cause and effect(s) of additional stimuli and transitions. Standards bodies and industry groups may extend the base Program Finite State Model to conform to various industry models. For example, the Halted state can include the sub states “Aborted” and “Completed” to indicate if the function achieved a successful conclusion prior to the transition to Halted.

Hierarchy

Index

Properties

currentState

currentState: FiniteStateVariable

Current state CurrentState stores the current state of an instance of the StateMachineType. CurrentState provides a human readable name for the current state which may not be suitable for use in application control logic. Applications should use the Id Property of CurrentState if they need a nique identifier for the state.

currentStateNode

currentStateNode: State

Readonly halt

halt: UAMethod

Halt Causes the Program to transition from the Ready, Running or Suspended state to the Halted state.

Readonly halted

halted: State

Readonly haltedToReady

haltedToReady: Transition

Readonly initialState

initialState: InitialState

Optional lastTransition

lastTransition: FiniteTransitionVariable

Last transition

LastTransition stores the last transition which occurred in an instance of the StateMachineType. LastTransition provides a human readable name.

Readonly ready

ready: State

Readonly readyToHalted

readyToHalted: Transition

Readonly readyToRunning

readyToRunning: Transition

reset

reset: UAMethod

Reset Causes the Program to transition from the Halted state to the Ready state

Readonly resume

resume: UAMethod

Resume Causes the Program to transition from the Suspended state to the Running state.

Readonly running

running: State

Readonly runningToHalted

runningToHalted: Transition

Readonly runningToReady

runningToReady: Transition

Readonly runningToSuspended

runningToSuspended: Transition

Readonly start

start: UAMethod

Start Causes the Program to transition from the Ready state to the Running state.

Readonly states

states: State[]

Readonly suspend

suspend: UAMethod

Suspend Causes the Program to transition from the Running state to the Suspended state.

Readonly suspended

suspended: State

Readonly suspendedToHalted

suspendedToHalted: Transition

Readonly suspendedToReady

suspendedToReady: Transition

Readonly suspendedToRunning

suspendedToRunning: Transition

Readonly transitions

transitions: Transition[]

Methods

findTransitionNode

getCurrentState

  • getCurrentState(): string
  • return the current state as string

    Returns string

getStateByName

  • getStateByName(name: string): State
  • return the state Node by Name

    Parameters

    • name: string

    Returns State

getStates

  • return all state nodes associated with this state machine

    Returns State[]

getTransitions

  • return all state to state transition node associated with this state machine

    Returns Transition[]

isValidTransition

  • returns true if there is a valid transition from currentStateNode to toStateNode

    Parameters

    Returns boolean

setState

  • change the current state

    note:

    • a transition from currentState to toState node must exists
    • a TransitionEventType event will be raised

    Parameters

    Returns void

Generated using TypeDoc