Type alias OrchestrationMachine<TLogic>

OrchestrationMachine<TLogic>: {
    getOrchestrationEvents?: ((sourceName?, initialContextZodSchema?) => {
        orchestrationError: MachineEventSchema;
        orchestrationEvents: MachineEventSchema[];
        orchestrationInit: MachineEventSchema;
    });
    machine: TLogic;
    onOrchestrationEvent: Record<string, OnOrchestrationEvent>;
    onOrchestrationState: Record<string, OnOrchestrationState>;
}

Represents the output of the createOrchestrationMachine function. This type encapsulates the machine created by xstate's createMachine function, along with additional configurations for handling orchestration events and states.

Type Parameters

  • TLogic extends AnyActorLogic

Type declaration

  • Optional getOrchestrationEvents?: ((sourceName?, initialContextZodSchema?) => {
        orchestrationError: MachineEventSchema;
        orchestrationEvents: MachineEventSchema[];
        orchestrationInit: MachineEventSchema;
    })

    Gets the events which are expected and emitted by the machine

    Returns

      • (sourceName?, initialContextZodSchema?): {
            orchestrationError: MachineEventSchema;
            orchestrationEvents: MachineEventSchema[];
            orchestrationInit: MachineEventSchema;
        }
      • Gets the events which are expected and emitted by the machine

        Parameters

        • Optional sourceName: string
        • Optional initialContextZodSchema: zod.ZodObject<any>

        Returns {
            orchestrationError: MachineEventSchema;
            orchestrationEvents: MachineEventSchema[];
            orchestrationInit: MachineEventSchema;
        }

        • orchestrationError: MachineEventSchema
        • orchestrationEvents: MachineEventSchema[]
        • orchestrationInit: MachineEventSchema
  • machine: TLogic

    The machine created by xstate's createMachine. It can be used in any xstate-compatible actor for execution.

  • onOrchestrationEvent: Record<string, OnOrchestrationEvent>

    A key-value map where the keys are event names, and the values are corresponding transformation functions. These functions are executed after receiving an event but before the event is ingested by the machine.

  • onOrchestrationState: Record<string, OnOrchestrationState>

    A key-value pair that instructs the orchestration actor to emit an event when a certain state is reached.

Typeparam

TLogic - The type of logic associated with the orchestration actor.

Generated using TypeDoc