arvo-event-handler
    Preparing search index...

    Class ArvoMachine<TId, TVersion, TSelfContract, TServiceContract, TLogic>

    Represents an ArvoMachine object that can be consumed by an Arvo orchestrator. ArvoMachine encapsulates the logic and metadata required for an Arvo-compatible state machine. It combines XState's actor logic with Arvo-specific contracts and versioning information.

    It is strongly recommended to use setupArvoMachine(...).createMachine(...) instead of creating this object directly. The setup function provides additional type safety and validation that helps prevent runtime errors.

    Type Parameters

    • TId extends string
    • TVersion extends ArvoSemanticVersion
    • TSelfContract extends VersionedArvoContract<ArvoOrchestratorContract, TVersion>
    • TServiceContract extends Record<string, VersionedArvoContract<ArvoContract, ArvoSemanticVersion>>
    • TLogic extends AnyActorLogic
    Index

    Constructors

    • Type Parameters

      • TId extends string
      • TVersion extends `${number}.${number}.${number}`
      • TSelfContract extends VersionedArvoContract<ArvoOrchestratorContract, TVersion>
      • TServiceContract extends Record<
            string,
            VersionedArvoContract<
                ArvoContract<
                    string,
                    string,
                    Record<
                        `${number}.${number}.${number}`,
                        { accepts: ZodTypeAny; emits: Record<string, z.ZodTypeAny> },
                    >,
                    Record<string, any>,
                >,
                `${number}.${number}.${number}`,
            >,
        >
      • TLogic extends AnyActorLogic

      Parameters

      Returns ArvoMachine<TId, TVersion, TSelfContract, TServiceContract, TLogic>

    Properties

    contracts: { self: TSelfContract; services: TServiceContract }
    id: TId
    logic: TLogic
    requiresResourceLocking: boolean = true
    version: TVersion

    Accessors

    Methods

    • Validates an event against the machine's contracts and data schemas. Performs validation for both self-contract events and service contract events.

      Parameters

      • event: ArvoEvent

        The event to validate

        See validateInputEvent for more infromation

      • Optionalspan: Span

      Returns EventValidationResult