Type alias BasicContext<TData>

BasicContext<TData>: {
    __cloudevent?: CloudEvent<Record<string, any>>;
    __cumulativeExecutionUnits?: {
        event_type: string;
        units: `${number}`;
    }[];
    __machineLogs?: {
        cloudevent: CloudEvent<any>;
        cloudeventId: string;
        context: Record<string, any>;
        isoTime: string;
        timestamp: number;
    }[];
    __orchestrationTime?: {
        checkpoint: number;
        elapsed: number;
        event_type: string;
        start: number;
    }[];
    __traceId?: string;
} & TData

Represents the standard context for a state machine, incorporating critical metadata that enhances monitoring and analysis of the state machine's operation. This context is designed to be extended with specific state data for a customized state machine context.

Type Parameters

  • TData extends Record<string, any>

Type declaration

  • Optional __cloudevent?: CloudEvent<Record<string, any>>
  • Optional __cumulativeExecutionUnits?: {
        event_type: string;
        units: `${number}`;
    }[]
  • Optional __machineLogs?: {
        cloudevent: CloudEvent<any>;
        cloudeventId: string;
        context: Record<string, any>;
        isoTime: string;
        timestamp: number;
    }[]
  • Optional __orchestrationTime?: {
        checkpoint: number;
        elapsed: number;
        event_type: string;
        start: number;
    }[]
  • Optional __traceId?: string

Typeparam

TData The type of additional data fields that can be added to the basic context structure.

Attributes:

  • __traceId: An optional OpenTelemetry trace ID that uniquely identifies the workflow's execution trace, facilitating the tracing of transactions and operations across distributed systems.
  • __machineLogs: An array of logs capturing a chronological record of all significant state updates and actions taken by the state machine. Primarily used for debugging and audit purposes.
  • __cloudevent: An optional field storing the most recently received CloudEvent, which standardizes event data across services, platforms, and systems, promoting interoperability.
  • __orchestrationTime: Records timing details of significant events within the state machine's operation, tracking the start times and durations, useful for performance analysis and optimization.
  • __cumulativeExecutionUnits: Tracks the computational effort expended by the state machine, recording the type of event and the computation units consumed, aiding in resource management and operational analysis.

Generated using TypeDoc