Skip to content

StateBuilder

Defined in: builder/state-machine.ts:10

Represents a single state in the state machine for a template item.

readonly key: string

Defined in: builder/state-machine.ts:11


readonly parent: TemplateBuilder

Defined in: builder/state-machine.ts:12


readonly prn: string

Defined in: builder/index.ts:32

BaseBuilder.prn


readonly transitions: Record<string, TransitionBuilder>

Defined in: builder/state-machine.ts:13

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.

string

StateBuilder

TransitionBuilder


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

this


setDescription(description): this

Defined in: builder/index.ts:33

string

this

BaseBuilder.setDescription


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.

this

setDefault


toDefinition(): StateDefinition

Defined in: builder/state-machine.ts:41

Returns the definition object for this state.

StateDefinition