StateBuilder
Defined in: builder/state-machine.ts:10
Represents a single state in the state machine for a template item.
Extends
Section titled “Extends”Properties
Section titled “Properties”
readonlykey:string
Defined in: builder/state-machine.ts:11
parent
Section titled “parent”
readonlyparent:TemplateBuilder
Defined in: builder/state-machine.ts:12
readonlyprn:string
Defined in: builder/index.ts:32
Inherited from
Section titled “Inherited from”transitions
Section titled “transitions”
readonlytransitions:Record<string,TransitionBuilder>
Defined in: builder/state-machine.ts:13
Methods
Section titled “Methods”addTransition()
Section titled “addTransition()”addTransition(
key,to):TransitionBuilder
Defined in: builder/state-machine.ts:23
Creates a new state transition FROM this state to another state. The other state must be from the same template. All state transitions are directional and loops are permitted.
Multiple transitions from the same state to another are permitted, but they require unique keys.
Parameters
Section titled “Parameters”string
StateBuilder
Returns
Section titled “Returns”setDefault()
Section titled “setDefault()”setDefault():
this
Defined in: builder/state-machine.ts:29
Sets this state as the default for this template. If a default has already been set, this simply overrides that last value
Returns
Section titled “Returns”this
setDescription()
Section titled “setDescription()”setDescription(
description):this
Defined in: builder/index.ts:33
Parameters
Section titled “Parameters”description
Section titled “description”string
Returns
Section titled “Returns”this
Inherited from
Section titled “Inherited from”setInitial()
Section titled “setInitial()”setInitial():
this
Defined in: builder/state-machine.ts:36
If set, this state is valid as an initial state for a newly created item. Default state are always initial states.
Returns
Section titled “Returns”this
setDefault
toDefinition()
Section titled “toDefinition()”toDefinition():
StateDefinition
Defined in: builder/state-machine.ts:41
Returns the definition object for this state.