Options
All
  • Public
  • Public/Protected
  • All
Menu

The Transition class is responsible for encapsulating a single mutation for a single machine. In can be created by a different machine than it's mutating. End users usually don't have to deal with it at all, as the most important data it carries for them is exposed as instance.to() and instance.from() methods and it's events are also emitted on the machine itself.

Hierarchy

  • Transition

Index

Constructors

constructor

Properties

accepted

accepted: boolean = true

before

before: string[]

cancelled

cancelled: boolean = false

enters

enters: string[] = []

exits

exits: string[] = []

id

id: any = uuid()

row

source_machine

source_machine: AsyncMachine<any, IBind, IEmit>

states

states: string[] = []

steps

steps: ITransitionStep[] = []

Accessors

auto

auto:

machine

machine:

params

params:

requested_states

requested_states:

type

type:

Methods

addStep

addStepData

addStepsFor

enter

  • enter(to: string): any

exec

  • exec(): boolean

exit

  • exit(from: string): boolean

isStateBlocked_

  • isStateBlocked_(states: string[], name: string): string[]
  • Returns the subset of states which block the state name.

    Parameters

    • states: string[]
    • name: string

    Returns string[]

orderStates_

  • orderStates_(states: string[]): void

parseImplies_

  • parseImplies_(states: string[]): string[]

parseRequires_

  • parseRequires_(states: string[]): string[]

prepareAutoStates

processPostTransition

  • processPostTransition(): void

processPostTransitionException

  • processPostTransitionException(state: string, is_enter: boolean): void
  • Parameters

    • state: string
    • is_enter: boolean

    Returns void

removeDuplicateStates_

  • removeDuplicateStates_(states: string[]): string[]

resolveRelations

  • resolveRelations(states: string[]): void

self

  • self(): boolean

setupAccepted

  • setupAccepted(): void

setupExitEnter

  • setupExitEnter(): void

toString

  • toString(): string
  • Produces a readable list of steps states.

    Example:

    A   REQUESTED
    D   REQUESTED
    A   SET
    D   SET
    D -> B   RELATION   add
    D -> C   RELATION   add
    B   SET
    C   SET
    E -> D   RELATION   drop
    E   DROP
    

    TODO loose casts once condition guards work again

    Returns string

transitionExec_

  • transitionExec_(from: string, to: string | null, method: string, params?: string[]): any
  • Parameters

    • from: string
    • to: string | null
    • method: string
    • Default value params: string[] = []

    Returns any

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc