Optional always?: OrchestrationTransitionConfig<TEventTransformer> | OrchestrationTransitionConfig<TEventTransformer>[]Configuration for an abrupt state transition if this state is reached. Defines a transition to be executed whenever this state is reached, regardless of the current event.
Optional description?: stringDescription of the state, providing additional context or information about its purpose. This can be helpful for documentation and understanding the intended behavior of the state.
Optional emit?: OnOrchestrationStateEmit<TContext, TEmit> | TEmitName of the function or the function to run when this state is reached.
Provided in the emits key in the options of createOrchestrationMachine.
These functions represent the behavior or side-effects to perform upon reaching this state.
Optional entry?: string | string[]Name(s) of the functions to run when this state is entered.
Provided in the actions key in the options of createOrchestrationMachine.
These functions represent the behavior or side-effects to perform upon entering this state.
Optional eventThe schema of the emit this state emits. It helps in documentation
Optional exit?: string | string[]Name of the function to run when this state is exited.
Provided in the actions key in the options of createOrchestrationMachine.
These functions represent the behavior or side-effects to perform upon exiting this state.
Optional initial?: stringInitial state if the state type is not 'parallel'. Required if the state type is not 'parallel'.
Optional on?: Record<OrchestrationMachineAllowedStringKeys, OrchestrationTransitionConfig<TEventTransformer> | OrchestrationTransitionConfig<TEventTransformer>[]>Key-value pair of events accepted by this state, with corresponding transition configurations. Defines the events that can trigger transitions from this state and the associated transition configurations.
Optional onTarget state to go to when all parallel states are done (applicable only for 'parallel' type). Specifies the state to transition to when all parallel states under this state have completed their execution.
Optional states?: Record<OrchestrationMachineAllowedStringKeys, OrchestrationStateConfig<TContext, TEmit, TEventTransformer>>Nested states for parallel or final states. Allows defining sub-states for the 'parallel' or 'final' state, forming a hierarchical structure.
Optional type?: OrchestrationStateTypeType of the state, either 'parallel' or 'final'. For 'parallel' type, multiple states run together simultaneously. For 'final' type, the orchestration has ended.
// Example state configuration:
const stateConfig: OrchestrationStateConfig = {
type: 'parallel',
emit: ['notifyUser', 'updateStateData'],
onDone: { target: 'nextState' },
states: {
subState1: { type: 'final', emit: 'finalizeState1' },
subState2: { },
},
};
Generated using TypeDoc
Configuration for an orchestration machine state.