Options
All
  • Public
  • Public/Protected
  • All
Menu

Class FSM

A FSM is a MetaElement representing a finite state machine.

FSMs are mutable

specfield

states : set of states within the FSM

specfield

transitions: set of transitions within the FSM

Hierarchy

Index

Constructors

constructor

  • Creates a new FSM f so that:

    • f.name = FSM_ + attachedBOT.name &&
    • f.states = states || {}
    • f.transitions = transitions || {}

    Parameters

    • attachedBOT: BusinessObjectType

      Business Object Type to which the FSM will be attached

    • Default value states: Array<State> = new Array<State>()

      Set of states of the FSM

    • Default value transitions: Array<Transition> = new Array<Transition>()

      Set of transitions of the FSM

    Returns FSM

Properties

Private states

states: Map<string, State>

Private transitions

transitions: Map<string, Transition>

Methods

addState

  • addState(state: State): void
  • modifies

    this

    effects

    this_post.states = this.states U { state }

    Parameters

    • state: State

      New state to add to this

    Returns void

addTransition

getId

  • getId(): string

getName

  • getName(): string

getState

  • getState(stateId: string): State
  • throws

    an error in case there is no state with id stateId in this

    willreturn

    otherwise, returns a state s so that s.id = state.id && s is in this.states

    Parameters

    • stateId: string

      Id of the state to be retrieved

    Returns State

getStates

  • getStates(): Array<State>

getTransition

  • throws

    an error in case there is no transition with id transitionId in this

    willreturn

    otherwise, returns a transition so that t.id = transitionId && t is in this.transitions

    Parameters

    • transitionId: string

    Returns Transition

getTransitions

isValid

  • isValid(): boolean

setId

  • setId(id: string): void

toJSON

toModelFormat

Static createMapFromArray

  • createMapFromArray<MetaElementType>(elements: Array<MetaElementType>): Map<string, MetaElementType>

Static generateDefaultFSM

Static loadFromModelFormat

  • willreturn

    a new FSM that has the same name and same id as specified in modelElement (without loading states and transitions)

    Parameters

    • model: Model

      model containing the business object type to which the fsm to be created is attached

    • modelElement: IFSMModelFormat

      a representation of the fsm in the exported model format

    Returns FSM

Generated using TypeDoc