Public .NET API ReferenceL4 Orchestration & SagasStableAOT: Partial

EricksonLopez.Processes

High-performance, zero-reflection Process Manager and distributed Saga orchestration engine for modern .NET. Native AOT-ready, OCC CAS, and multi-database persistence.

18 namespaces107 types602 membersGenerated from XML docs & assemblies · UTC 2026-12-01

Showing 107 of 107 types (602 members)

EricksonLopez.Processes#

11
interface

IProcessRegistry

Assembly: EricksonLopez.Processes
public interface IProcessRegistry

Defines a registry for storing and resolving process definitions, handlers, and correlation extractors.

Members (2)

  • methodIsRegistered
    bool IsRegistered(ProcessType processType, ProcessVersion version)

    Determines whether a process definition of the specified type and version is registered.

    processType: ProcessType
    The logical process type identifier.
    version: ProcessVersion
    The schema or definition version.

    Returns: `true` if registered; otherwise, `false`.

  • propertyRegisteredProcesses
    IReadOnlyCollection<(ProcessType Type, ProcessVersion Version)> RegisteredProcesses { get; }

    Gets the collection of all registered process types and versions.

class

ProcessCoordinatorOptions

Assembly: EricksonLopez.Processes
public sealed class ProcessCoordinatorOptions

Provides configuration options for the `ProcessCoordinator<TState>` execution pipeline.

Members (3)

  • propertyInitialBackoffDelay
    public TimeSpan InitialBackoffDelay { get; set; }

    Gets or sets the initial backoff delay for retrying on concurrency conflicts.

    Exceptions: ArgumentOutOfRangeException: `value` is less than or equal to `TimeSpan.Zero`

  • propertyMaxCompensations
    public int MaxCompensations { get; set; }

    Gets or sets the maximum number of compensation steps allowed before throwing an exception to prevent infinite saga growth.

  • propertyMaxConcurrencyRetries
    public int MaxConcurrencyRetries { get; set; }

    Gets or sets the maximum number of optimistic concurrency retry attempts.

class

ProcessCoordinator<TState>

Assembly: EricksonLopez.Processes
public sealed class ProcessCoordinator<TState> : IProcessCoordinator<TState> where TState : notnull
Implements: IProcessCoordinator<TState>

Coordinates process lifecycle execution, handler invocation, optimistic concurrency retries, and persistence.

Remarks:

Type parameters: TState: The strongly typed domain state type.

Members (9)

  • constructorProcessCoordinator
    public ProcessCoordinator(IProcessStore<TState> store, ProcessCoordinatorOptions? options = null, TimeProvider? timeProvider = null, Func<int, TimeSpan>? backoffStrategy = null)

    Initializes a new instance of the `ProcessCoordinator<TState>` class with the specified store and options.

    store: IProcessStore<TState>
    The persistence store for process instances.
    options: ProcessCoordinatorOptions?
    The optional coordinator configuration options, or `null` for defaults.
    timeProvider: TimeProvider?
    The optional time provider instance, or `null` to use `TimeProvider.System`.
    backoffStrategy: Func<int, TimeSpan>?
    The optional backoff retry delay strategy, or `null`.

    Exceptions: ArgumentNullException: `store` is `null`

  • methodCompensateAsync<TSaga>
    public async ValueTask<ProcessExecutionResult<TState>> CompensateAsync<TSaga>(ProcessId processId, IReadOnlyList<CompensationStep> recordedSteps, TSaga saga, CancellationToken cancellationToken = default) where TSaga : IProcess<TState>, ICompensationHandler<TState>

    Executes reverse-order compensation steps for a saga using optimistic concurrency control.

    processId: ProcessId
    The unique process identifier of the saga to compensate.
    recordedSteps: IReadOnlyList<CompensationStep>
    The list of steps recorded during forward execution.
    saga: TSaga
    The saga instance providing compensation logic.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains the `ProcessExecutionResult<TState>`.

    Type parameters: TSaga: The saga definition and compensation handler type. Exceptions: ArgumentNullException: `recordedSteps` or `saga` is `null`; ProcessNotFoundException: The process instance was not found in storage

  • methodCompensateAsync<TSaga>
    public async ValueTask<ProcessExecutionResult<TState>> CompensateAsync<TSaga>(ProcessId processId, TSaga saga, CancellationToken cancellationToken = default) where TSaga : IProcess<TState>, ICompensationHandler<TState>

    Executes reverse-order compensation steps for a saga using optimistic concurrency control, automatically reading recorded compensation steps from the persisted process instance.

    processId: ProcessId
    The unique process identifier of the saga to compensate.
    saga: TSaga
    The saga instance providing compensation logic.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains the `ProcessExecutionResult<TState>`.

    Type parameters: TSaga: The saga definition and compensation handler type. Exceptions: ArgumentNullException: `saga` is `null`; ProcessNotFoundException: The process instance was not found in storage; ConcurrencyConflictException: Optimistic concurrency retries exceeded the configured maximum limit

  • methodCreateExponentialBackoffStrategy
    public static Func<int, TimeSpan> CreateExponentialBackoffStrategy(TimeSpan initialDelay)

    Creates an exponential backoff strategy with cryptographic PRNG jitter scaled from the specified initial delay.

    initialDelay: TimeSpan
    The base delay for the first retry attempt.

    Returns: A delegate computing the jittered exponential backoff `TimeSpan` for each attempt.

  • methodDefaultBackoffStrategy
    public static TimeSpan DefaultBackoffStrategy(int attempt)

    Calculates an exponential backoff delay with pseudo-random jitter.

    attempt: int
    The retry attempt index.

    Returns: The calculated backoff `TimeSpan` duration.

  • methodExecuteAsync<TEvent>
    public async ValueTask<ProcessExecutionResult<TState>> ExecuteAsync<TEvent>(IProcessHandler<TState, TEvent> handler, IProcessCorrelation<TEvent> correlation, TEvent eventMessage, Func<TEvent, TState>? initialStateFactory = null, bool canInitiate = false, CancellationToken cancellationToken = default)

    Executes a process handler against the targeted process instance with optimistic concurrency retries.

    handler: IProcessHandler<TState, TEvent>
    The typed process handler to invoke.
    correlation: IProcessCorrelation<TEvent>
    The correlation extractor used to obtain identifiers from the event.
    eventMessage: TEvent
    The incoming event instance to handle.
    initialStateFactory: Func<TEvent, TState>?
    The factory function to initialize state when a new instance is created.
    canInitiate: bool
    A value indicating whether this event is allowed to initiate a new process instance.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains the `ProcessExecutionResult<TState>`.

    Type parameters: TEvent: The incoming event payload type. Exceptions: ArgumentNullException: `handler`, `correlation`, or `eventMessage` is `null`; ArgumentNullException: `initialStateFactory` is `null` when `canInitiate` is `true`; ProcessNotFoundException: The process instance was not found and `canInitiate` is `false`; ConcurrencyConflictException: Optimistic concurrency retries exceeded the configured maximum limit

  • methodInitiateAsync<TEvent>
    public ValueTask<ProcessExecutionResult<TState>> InitiateAsync<TEvent>(IProcessHandler<TState, TEvent> handler, IProcessCorrelation<TEvent> correlation, TEvent eventMessage, Func<TEvent, TState> initialStateFactory, CancellationToken cancellationToken = default)

    Initiates a new process instance using a required initial state factory and executes the initial message transition.

    handler: IProcessHandler<TState, TEvent>
    The typed process handler to invoke.
    correlation: IProcessCorrelation<TEvent>
    The correlation extractor used to obtain identifiers from the event.
    eventMessage: TEvent
    The incoming event instance to handle.
    initialStateFactory: Func<TEvent, TState>
    The required factory function to initialize state when a new instance is created.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains the `ProcessExecutionResult<TState>`.

    Type parameters: TEvent: The initiating event payload type. Exceptions: ArgumentNullException: `handler`, `correlation`, `eventMessage`, or `initialStateFactory` is `null`

  • methodResumeAsync<TEvent>
    public ValueTask<ProcessExecutionResult<TState>> ResumeAsync<TEvent>(IProcessHandler<TState, TEvent> handler, IProcessCorrelation<TEvent> correlation, TEvent eventMessage, CancellationToken cancellationToken = default)

    Resumes an existing persisted process instance and executes the specified continuation message transition. Throws `ProcessNotFoundException` if the process instance does not exist in storage.

    handler: IProcessHandler<TState, TEvent>
    The typed process handler to invoke.
    correlation: IProcessCorrelation<TEvent>
    The correlation extractor used to obtain identifiers from the event.
    eventMessage: TEvent
    The incoming event instance to handle.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains the `ProcessExecutionResult<TState>`.

    Type parameters: TEvent: The continuation event payload type. Exceptions: ArgumentNullException: `handler`, `correlation`, or `eventMessage` is `null`; ProcessNotFoundException: The process instance was not found in storage

  • methodStartAsync<TEvent>
    public ValueTask<ProcessExecutionResult<TState>> StartAsync<TEvent>(IProcessHandler<TState, TEvent> handler, IProcessCorrelation<TEvent> correlation, TEvent eventMessage, Func<TEvent, TState> initialStateFactory, CancellationToken cancellationToken = default)

    Initiates a new process instance using a required initial state factory and executes the initial message transition.

    handler: IProcessHandler<TState, TEvent>
    The typed process handler to invoke.
    correlation: IProcessCorrelation<TEvent>
    The correlation extractor used to obtain identifiers from the event.
    eventMessage: TEvent
    The incoming event instance to handle.
    initialStateFactory: Func<TEvent, TState>
    The required factory function to initialize state when a new instance is created.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains the `ProcessExecutionResult<TState>`.

    Type parameters: TEvent: The initiating event payload type. Exceptions: ArgumentNullException: `handler`, `correlation`, `eventMessage`, or `initialStateFactory` is `null`

class

ProcessDefinitionBuilder<TState>

Assembly: EricksonLopez.Processes
public sealed class ProcessDefinitionBuilder<TState> where TState : notnull

Provides a fluent builder for defining and validating process finite-state machine transition graphs at startup.

Remarks:

Type parameters: TState: The domain state type.

Members (4)

  • constructorProcessDefinitionBuilder
    public ProcessDefinitionBuilder(ProcessType type, ProcessVersion version)

    Initializes a new instance of the `ProcessDefinitionBuilder<TState>` class.

    type: ProcessType
    The logical process type identifier.
    version: ProcessVersion
    The schema or definition version.
  • methodAddTransition
    public ProcessDefinitionBuilder<TState> AddTransition(ProcessStatus from, ProcessStatus to, string? stepName = null)

    Registers a directed transition edge between two process lifecycle statuses.

    from: ProcessStatus
    The source status.
    to: ProcessStatus
    The target status.
    stepName: string?
    The optional step or event name.

    Returns: The current builder instance for fluent chaining.

  • methodBuild
    public ProcessDefinition<TState> Build()

    Validates the transition graph and builds an immutable `ProcessDefinition<TState>`.

    Returns: A validated `ProcessDefinition<TState>` instance.

  • methodValidateGraph
    public void ValidateGraph()

    Validates the registered transition graph for reachability from `ProcessStatus.Initialized`, absence of dead-end non-terminal states, and lifecycle transition legality.

    Exceptions: InvalidOperationException: The graph is empty, contains illegal lifecycle edges, unreachable states, or dead-end states that cannot reach a terminal status

class

ProcessDefinition<TState>

Assembly: EricksonLopez.Processes
public sealed class ProcessDefinition<TState> where TState : notnull

Represents a validated finite-state machine graph definition for a process type.

Remarks:

Type parameters: TState: The domain state type.

Members (5)

  • constructorProcessDefinition
    public ProcessDefinition(ProcessType type, ProcessVersion version, IReadOnlyList<ProcessTransitionEdge> transitions)

    Initializes a new instance of the `ProcessDefinition<TState>` class.

    type: ProcessType
    The logical process type identifier.
    version: ProcessVersion
    The process definition version.
    transitions: IReadOnlyList<ProcessTransitionEdge>
    The directed transition edges.
  • methodValidateGraph
    public void ValidateGraph()

    Validates that all transitions in this definition form a valid, connected directed graph where all non-terminal states are reachable from `ProcessStatus.Initialized` and can reach at least one terminal state.

    Exceptions: InvalidOperationException: The transition graph contains invalid transitions, unreachable states, or dead-end non-terminal states

  • propertyTransitions
    public IReadOnlyList<ProcessTransitionEdge> Transitions { get; }

    Gets the registered directed transition edges in this process definition.

  • propertyType
    public ProcessType Type { get; }

    Gets the logical process type identifier.

  • propertyVersion
    public ProcessVersion Version { get; }

    Gets the schema or definition version.

class

ProcessDiagnostics

Assembly: EricksonLopez.Processes
public static partial class ProcessDiagnostics

Provides standard observability instruments for process execution and tracing.

Members (12)

  • methodClassifyFailureReason
    public static ProcessFailureCategory ClassifyFailureReason(string? reason)

    Classifies an arbitrary failure reason string into a strictly bounded `ProcessFailureCategory`.

    reason: string?
    The raw failure reason string.

    Returns: A bounded `ProcessFailureCategory` value.

  • methodRecordConcurrencyConflict
    public static void RecordConcurrencyConflict(string processType, int version)

    Records a metric event indicating an optimistic concurrency conflict during state persistence.

    processType: string
    The logical process type name.
    version: int
    The schema or definition version number.
  • methodRecordProcessCompensated
    public static void RecordProcessCompensated(string processType, int version)

    Records a metric event indicating that a saga successfully completed compensation.

    processType: string
    The logical process type name.
    version: int
    The schema or definition version number.
  • methodRecordProcessCompleted
    public static void RecordProcessCompleted(string processType, int version)

    Records a metric event indicating that a process instance completed successfully.

    processType: string
    The logical process type name.
    version: int
    The schema or definition version number.
  • methodRecordProcessFailed
    public static void RecordProcessFailed(string processType, int version, ProcessFailureCategory category)

    Records a metric event indicating that a process instance failed with an explicit bounded `ProcessFailureCategory`.

    processType: string
    The logical process type name.
    version: int
    The schema or definition version number.
    category: ProcessFailureCategory
    The bounded failure category.
  • methodRecordProcessFailed
    public static void RecordProcessFailed(string processType, int version, string? reason)

    Records a metric event indicating that a process instance failed, using a bounded failure category to prevent secret leakage and metric cardinality explosion.

    processType: string
    The logical process type name.
    version: int
    The schema or definition version number.
    reason: string?
    The optional failure reason explanation (classified into a bounded category for metrics and scrubbed for active trace events).
  • methodRecordProcessStarted
    public static void RecordProcessStarted(string processType, int version)

    Records a metric event indicating that a process instance was started.

    processType: string
    The logical process type name.
    version: int
    The schema or definition version number.
  • methodRecordTransitionDuration
    public static void RecordTransitionDuration(string processType, double durationMs)

    Records the execution duration of a process state transition.

    processType: string
    The logical process type name.
    durationMs: double
    The elapsed duration in milliseconds.
  • methodScrubSensitiveData
    public static string ScrubSensitiveData(string? input)

    Scrubs potential credentials, passwords, or tokens from a diagnostic string before recording to trace spans.

    input: string?
    The raw diagnostic message.

    Returns: A scrubbed message with sensitive key-value pairs redacted.

  • fieldActivitySource
    public static readonly ActivitySource ActivitySource

    Represents the `ActivitySource` that traces process lifecycles, state transitions, and compensations.

  • fieldMeter
    public static readonly Meter Meter

    Represents the `Meter` that emits process execution metrics.

  • fieldSourceName
    public const string SourceName

    Represents the diagnostic telemetry source name.

enum

ProcessFailureCategory

Assembly: EricksonLopez.Processes
public enum ProcessFailureCategory

Defines strictly bounded failure categories for OpenTelemetry metric dimensions to prevent cardinality explosion and credential leakage.

Members (8)

  • fieldBusinessRuleViolation
    BusinessRuleViolation = 2

    Indicates that a domain business rule rejected the state transition.

  • fieldCompensationFailure
    CompensationFailure = 6

    Indicates that a saga compensation step failed during rollback.

  • fieldConcurrencyConflict
    ConcurrencyConflict = 4

    Optimistic concurrency retries were exhausted.

  • fieldDatabase
    Database = 7

    Indicates that a database or connection failure occurred.

  • fieldTimeout
    Timeout = 5

    Indicates that an operation timed out.

  • fieldTransientFault
    TransientFault = 1

    Indicates that a transient infrastructure or network fault occurred.

  • fieldUnknown
    Unknown = 0

    Indicates that the failure category is unknown or unspecified.

  • fieldValidationFailure
    ValidationFailure = 3

    Input or state validation failed.

class

ProcessRegistry

Assembly: EricksonLopez.Processes
public sealed class ProcessRegistry : IProcessRegistry
Implements: IProcessRegistry

Provides a thread-safe registry holding registered process types and versions.

Members (3)

  • methodIsRegistered
    public bool IsRegistered(ProcessType processType, ProcessVersion version)

    Determines whether a process definition of the specified type and version is registered.

    processType: ProcessType
    The logical process type identifier.
    version: ProcessVersion
    The schema or definition version.

    Returns: `true` if registered; otherwise, `false`.

  • methodRegister
    public void Register(ProcessType processType, ProcessVersion version)

    Registers a process type and version in the registry.

    processType: ProcessType
    The logical process type identifier.
    version: ProcessVersion
    The schema or definition version.
  • propertyRegisteredProcesses
    public IReadOnlyCollection<(ProcessType Type, ProcessVersion Version)> RegisteredProcesses { get; }

    Gets the collection of all registered process types and versions.

class

ProcessStateMigrationPipeline

Assembly: EricksonLopez.Processes
public static class ProcessStateMigrationPipeline

Provides fluent factory methods to compose multi-step schema migration pipelines into a single migrator.

Members (1)

  • methodCreate<TInitialState>
    public static ProcessStateMigrationPipelineBuilder<TInitialState> Create<TInitialState>(ProcessVersion initialVersion) where TInitialState : notnull

    Starts building a sequential state migration pipeline beginning at the specified initial version.

    initialVersion: ProcessVersion
    The version of the initial schema.

    Returns: A new `ProcessStateMigrationPipelineBuilder<TInitialState>` instance.

    Type parameters: TInitialState: The type of the initial state schema.

class

ProcessStateMigrationPipelineBuilder<TCurrentState>

Assembly: EricksonLopez.Processes
public sealed class ProcessStateMigrationPipelineBuilder<TCurrentState> where TCurrentState : notnull

Constructs sequential, deterministic state migration pipelines.

Remarks:

Type parameters: TCurrentState: The state type at the current migration step.

Members (3)

  • methodAddStep<TNextState>
    public ProcessStateMigrationPipelineBuilder<TNextState> AddStep<TNextState>(IProcessStateMigrator<TCurrentState, TNextState> migrator) where TNextState : notnull

    Appends a typed `IProcessStateMigrator<TFrom, TTo>` step to the pipeline.

    migrator: IProcessStateMigrator<TCurrentState, TNextState>
    The migrator instance to append.

    Returns: A new `ProcessStateMigrationPipelineBuilder<TNextState>` advanced to `TNextState`.

    Type parameters: TNextState: The destination state type for this step. Exceptions: ArgumentNullException: `migrator` is `null`; InvalidOperationException: The migrator source version does not match the current pipeline version

  • methodAddStep<TNextState>
    public ProcessStateMigrationPipelineBuilder<TNextState> AddStep<TNextState>(ProcessVersion targetVersion, Func<TCurrentState, TNextState> transformer) where TNextState : notnull

    Appends a transformation function step to the pipeline.

    targetVersion: ProcessVersion
    The version of the state schema produced by this step.
    transformer: Func<TCurrentState, TNextState>
    The migration transformation function.

    Returns: A new `ProcessStateMigrationPipelineBuilder<TNextState>` advanced to `TNextState`.

    Type parameters: TNextState: The destination state type for this step. Exceptions: ArgumentNullException: `transformer` is `null`

  • methodBuild<TFrom>
    public IProcessStateMigrator<TFrom, TCurrentState> Build<TFrom>() where TFrom : notnull

    Builds the composed `IProcessStateMigrator<TFrom, TTo>` executing all steps sequentially.

    Returns: An instance of `IProcessStateMigrator<TFrom, TTo>` that executes all pipeline steps.

    Type parameters: TFrom: The initial source state type.

record

ProcessTransitionEdge

Assembly: EricksonLopez.Processes
public readonly record struct ProcessTransitionEdge(ProcessStatus From, ProcessStatus To, string? StepName)

Represents a directed state transition edge in a process finite-state machine definition.

Members (4)

  • constructorProcessTransitionEdge
    public ProcessTransitionEdge(ProcessStatus From, ProcessStatus To, string? StepName = null)

    Initializes a new instance of ProcessTransitionEdge.

    From: ProcessStatus
    The source lifecycle status.
    To: ProcessStatus
    The target lifecycle status.
    StepName: string?
    The optional logical step or message name associated with the edge.
  • propertyFrom
    public ProcessStatus From { get; init; }

    The source lifecycle status.

  • propertyStepName
    public string? StepName { get; init; }

    The optional logical step or message name associated with the edge.

  • propertyTo
    public ProcessStatus To { get; init; }

    The target lifecycle status.

EricksonLopez.Processes.Abstractions#

44
record

CausationId

Assembly: EricksonLopez.Processes.Abstractions
public readonly record struct CausationId : IComparable<CausationId>, IComparable, ISpanFormattable, ISpanParsable<CausationId>, IUtf8SpanParsable<CausationId>
Implements: IComparable, IComparable<CausationId>, ISpanFormattable, ISpanParsable<CausationId>, IUtf8SpanParsable<CausationId>

Represents a strongly typed identifier for the direct trigger or parent message that caused an action.

Members (26)

  • constructorCausationId
    public CausationId(string value)

    Initializes a new instance of the `CausationId` struct with the specified string value.

    value: string
    The causation identifier string.

    Exceptions: ArgumentException: `value` is `null` or white-space

  • methodCompareTo
    public int CompareTo(CausationId other)

    Inherits documentation from base type or interface.

    other: CausationId
  • methodCompareTo
    public int CompareTo(object? obj)

    Inherits documentation from base type or interface.

    obj: object?
  • methodFrom
    public static CausationId From(string value)

    Creates a `CausationId` from the specified string.

    value: string
    The causation identifier string.

    Returns: A new `CausationId` instance.

    Exceptions: ArgumentException: `value` is `null` or white-space

  • methodFromGuid
    public static CausationId FromGuid(Guid value)

    Creates a `CausationId` from the specified `Guid`.

    value: Guid
    The unique identifier GUID.

    Returns: A new `CausationId` instance.

  • methodFromString
    public static CausationId FromString(string value)

    Creates a `CausationId` from the specified string.

    value: string
    The causation identifier string.

    Returns: A new `CausationId` instance.

    Exceptions: ArgumentException: `value` is `null` or white-space

  • methodNewId
    public static CausationId NewId()

    Creates a new `CausationId` from a time-ordered UUIDv7.

    Returns: A new `CausationId` instance.

  • methodParse
    public static CausationId Parse(ReadOnlySpan<byte> utf8Text)

    Parses a span of UTF-8 bytes into a `CausationId`.

    utf8Text: ReadOnlySpan<byte>
    The span of UTF-8 bytes to parse.

    Returns: The parsed `CausationId`.

  • methodParse
    public static CausationId Parse(ReadOnlySpan<byte> utf8Text, IFormatProvider? provider)

    Inherits documentation from base type or interface.

    utf8Text: ReadOnlySpan<byte>
    provider: IFormatProvider?
  • methodParse
    public static CausationId Parse(ReadOnlySpan<char> s)

    Parses a span of characters into a `CausationId`.

    s: ReadOnlySpan<char>
    The span of characters to parse.

    Returns: The parsed `CausationId`.

    Exceptions: ArgumentException: `s` is empty or white-space

  • methodParse
    public static CausationId Parse(ReadOnlySpan<char> s, IFormatProvider? provider)

    Inherits documentation from base type or interface.

    s: ReadOnlySpan<char>
    provider: IFormatProvider?
  • methodParse
    public static CausationId Parse(string s)

    Parses a string into a `CausationId`.

    s: string
    The string to parse.

    Returns: The parsed `CausationId`.

  • methodParse
    public static CausationId Parse(string s, IFormatProvider? provider)

    Inherits documentation from base type or interface.

    s: string
    provider: IFormatProvider?
  • methodToString
    public override string ToString()

    Inherits documentation from base type or interface.

  • methodToString
    public string ToString(string? format, IFormatProvider? formatProvider)

    Inherits documentation from base type or interface.

    format: string?
    formatProvider: IFormatProvider?
  • methodTryFormat
    public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider)

    Inherits documentation from base type or interface.

    destination: Span<char>
    charsWritten: out int
    format: ReadOnlySpan<char>
    provider: IFormatProvider?
  • methodTryParse
    public static bool TryParse(ReadOnlySpan<byte> utf8Text, IFormatProvider? provider, out CausationId result)

    Inherits documentation from base type or interface.

    utf8Text: ReadOnlySpan<byte>
    provider: IFormatProvider?
    result: out CausationId
  • methodTryParse
    public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out CausationId result)

    Inherits documentation from base type or interface.

    s: ReadOnlySpan<char>
    provider: IFormatProvider?
    result: out CausationId
  • methodTryParse
    public static bool TryParse(string? s, IFormatProvider? provider, out CausationId result)

    Inherits documentation from base type or interface.

    s: string?
    provider: IFormatProvider?
    result: out CausationId
  • methodexplicit operator CausationId
    public static explicit operator CausationId(string value)

    Converts a string to a `CausationId` instance.

    value: string
    The causation identifier string.

    Exceptions: ArgumentException: `value` is `null` or white-space

  • methodimplicit operator string
    public static implicit operator string(CausationId id)

    Converts a `CausationId` to its underlying string representation.

    id: CausationId
    The causation identifier to convert.
  • methodoperator <
    public static bool operator <(CausationId left, CausationId right)

    Determines whether one `CausationId` instance is less than another.

    left: CausationId
    The first causation identifier to compare.
    right: CausationId
    The second causation identifier to compare.

    Returns: `true` if `left` is less than `right`; otherwise, `false`.

  • methodoperator <=
    public static bool operator <=(CausationId left, CausationId right)

    Determines whether one `CausationId` instance is less than or equal to another.

    left: CausationId
    The first causation identifier to compare.
    right: CausationId
    The second causation identifier to compare.

    Returns: `true` if `left` is less than or equal to `right`; otherwise, `false`.

  • methodoperator >
    public static bool operator >(CausationId left, CausationId right)

    Determines whether one `CausationId` instance is greater than another.

    left: CausationId
    The first causation identifier to compare.
    right: CausationId
    The second causation identifier to compare.

    Returns: `true` if `left` is greater than `right`; otherwise, `false`.

  • methodoperator >=
    public static bool operator >=(CausationId left, CausationId right)

    Determines whether one `CausationId` instance is greater than or equal to another.

    left: CausationId
    The first causation identifier to compare.
    right: CausationId
    The second causation identifier to compare.

    Returns: `true` if `left` is greater than or equal to `right`; otherwise, `false`.

  • propertyValue
    public string Value { get; }

    Gets the string value of the causation identifier.

record

CompensationAction

Assembly: EricksonLopez.Processes.Abstractions
public sealed record CompensationAction

Represents an executable compensation instruction that semantically undoes or mitigates a completed step.

Members (6)

  • constructorCompensationAction
    public CompensationAction(string stepName, object payload)

    Initializes a new instance of the `CompensationAction` record with the specified step name and payload.

    stepName: string
    The unique logical name of the step to compensate.
    payload: object
    The payload containing parameters required to execute the compensation.

    Exceptions: ArgumentException: `stepName` is `null` or white-space; ArgumentNullException: `payload` is `null`

  • methodCreate<TPayload>
    public static CompensationAction Create<TPayload>(string stepName, TPayload payload) where TPayload : notnull

    Creates a new `CompensationAction` instance with the specified step name and payload.

    stepName: string
    The unique logical name of the step to compensate.
    payload: TPayload
    The compensation action payload.

    Returns: A new `CompensationAction` instance.

    Type parameters: TPayload: The type of the payload. Exceptions: ArgumentException: `stepName` is `null` or white-space; ArgumentNullException: `payload` is `null`

  • methodExtractPayload<T>
    public T ExtractPayload<T>()

    Extracts the compensation payload cast to the specified type.

    Returns: The payload cast to `T`.

    Type parameters: T: The expected payload type.

  • methodTryExtractPayload<T>
    public bool TryExtractPayload<T>(out T? payload)

    Attempts to extract the compensation payload as the specified type.

    payload: out T?
    When this method returns, contains the typed payload if successful; otherwise, the default value for `T`.

    Returns: `true` if the payload is of type `T`; otherwise, `false`.

    Type parameters: T: The expected payload type.

  • propertyPayload
    public object Payload { get; init; }

    Gets the payload containing parameters required to execute the compensation.

  • propertyStepName
    public string StepName { get; init; }

    Gets the unique logical name of the step to compensate.

class

CompensationFailedException

Assembly: EricksonLopez.Processes.Abstractions
public sealed class CompensationFailedException : ProcessException
Inherits: ProcessException

Represents errors caused by a failure during saga compensation execution.

Members (5)

  • constructorCompensationFailedException
    public CompensationFailedException()

    Initializes a new instance of the `CompensationFailedException` class.

  • constructorCompensationFailedException
    public CompensationFailedException(ProcessId processId, string stepName, string reason, Exception? innerException = null)

    Initializes a new instance of the `CompensationFailedException` class with the step name and failure details.

    processId: ProcessId
    The unique process identifier.
    stepName: string
    The name of the step that failed to compensate.
    reason: string
    The explanation of the failure.
    innerException: Exception?
    The exception that is the cause of the current exception, or `null`.
  • constructorCompensationFailedException
    public CompensationFailedException(string message)

    Initializes a new instance of the `CompensationFailedException` class with a specified error message.

    message: string
    The message that describes the error.
  • constructorCompensationFailedException
    public CompensationFailedException(string message, Exception? innerException)

    Initializes a new instance of the `CompensationFailedException` class with a specified error message and inner exception.

    message: string
    The error message that explains the reason for the exception.
    innerException: Exception?
    The exception that is the cause of the current exception, or `null`.
  • propertyStepName
    public string StepName { get; }

    Gets the name of the step that failed to compensate.

record

CompensationStep

Assembly: EricksonLopez.Processes.Abstractions
public sealed record CompensationStep

Represents a recorded milestone of a completed saga step, storing the payload required for reverse compensation.

Members (11)

  • constructorCompensationStep
    public CompensationStep(string stepName, object payload, DateTimeOffset recordedAt, string? failureReason = null, DateTimeOffset? failedAt = null)

    Initializes a new instance of the `CompensationStep` record with the specified step name, payload, and timestamp.

    stepName: string
    The unique logical name of the step.
    payload: object
    The payload recorded during forward execution.
    recordedAt: DateTimeOffset
    The UTC timestamp when the step was recorded.
    failureReason: string?
    The optional failure reason explanation.
    failedAt: DateTimeOffset?
    The optional UTC timestamp when the step failed.

    Exceptions: ArgumentException: `stepName` is `null` or white-space; ArgumentNullException: `payload` is `null`

  • methodCreate<TPayload>
    public static CompensationStep Create<TPayload>(string stepName, TPayload payload, DateTimeOffset recordedAt) where TPayload : notnull

    Creates a new `CompensationStep` instance with the specified step name, payload, and timestamp.

    stepName: string
    The unique logical name of the step.
    payload: TPayload
    The recorded step payload.
    recordedAt: DateTimeOffset
    The UTC timestamp when the step was recorded.

    Returns: A new `CompensationStep` instance.

    Type parameters: TPayload: The type of the recorded payload. Exceptions: ArgumentException: `stepName` is `null` or white-space; ArgumentNullException: `payload` is `null`

  • methodExtractPayload<T>
    public T ExtractPayload<T>()

    Extracts the recorded payload cast to the specified type.

    Returns: The payload cast to `T`.

    Type parameters: T: The expected payload type.

  • methodTryExtractPayload<T>
    public bool TryExtractPayload<T>(out T? payload)

    Attempts to extract the recorded payload as the specified type.

    payload: out T?
    When this method returns, contains the typed payload if successful; otherwise, the default value for `T`.

    Returns: `true` if the payload is of type `T`; otherwise, `false`.

    Type parameters: T: The expected payload type.

  • methodWithFailure
    public CompensationStep WithFailure(string failureReason, DateTimeOffset failedAt)

    Creates a copy of this compensation step annotated with failure details.

    failureReason: string
    The failure reason explanation.
    failedAt: DateTimeOffset
    The UTC timestamp when the failure occurred.

    Returns: A new `CompensationStep` record with failure information recorded.

  • propertyFailedAt
    public DateTimeOffset? FailedAt { get; init; }

    Gets the UTC timestamp when the failure occurred, if any.

  • propertyFailureReason
    public string? FailureReason { get; init; }

    Gets the failure reason explanation if this compensation step failed.

  • propertyHasFailed
    public bool HasFailed { get; }

    Gets a value indicating whether this compensation step has failed.

  • propertyPayload
    public object Payload { get; init; }

    Gets the payload recorded during forward execution.

  • propertyRecordedAt
    public DateTimeOffset RecordedAt { get; init; }

    Gets the UTC timestamp when the step was recorded.

  • propertyStepName
    public string StepName { get; init; }

    Gets the unique logical step name.

class

CompensationStepJsonSerializer

Assembly: EricksonLopez.Processes.Abstractions
public static class CompensationStepJsonSerializer

Provides Native AOT and trimming-safe JSON serialization and deserialization for `CompensationStep` collections.

Members (2)

  • methodDeserialize
    public static IReadOnlyList<CompensationStep> Deserialize(string? json)

    Deserializes a JSON array string into a read-only list of `CompensationStep` instances.

    json: string?
    The JSON array string to deserialize.

    Returns: A read-only list of `CompensationStep` instances.

  • methodSerialize
    public static string Serialize(IReadOnlyList<CompensationStep>? steps)

    Serializes a list of `CompensationStep` instances to a JSON array string.

    steps: IReadOnlyList<CompensationStep>?
    The compensation steps to serialize.

    Returns: A JSON array string representing the recorded compensation steps.

record

CompositeCorrelationKey

Assembly: EricksonLopez.Processes.Abstractions
public readonly record struct CompositeCorrelationKey : IEquatable<CompositeCorrelationKey>
Implements: IEquatable<CompositeCorrelationKey>

Represents a composite, deterministic correlation key constructed from multiple business identifiers.

Members (7)

  • constructorCompositeCorrelationKey
    public CompositeCorrelationKey(params string[] parts)

    Initializes a new instance of the `CompositeCorrelationKey` struct with the specified key parts.

    parts: params string[]
    The key parts to combine.

    Exceptions: ArgumentNullException: `parts` is `null`; ArgumentException: `parts` is empty or contains elements that are `null` or white-space

  • methodFrom<T1, T2, T3, T4>
    public static CompositeCorrelationKey From<T1, T2, T3, T4>(T1 part1, T2 part2, T3 part3, T4 part4) where T1 : notnull where T2 : notnull where T3 : notnull where T4 : notnull

    Creates a new composite correlation key from four strongly typed parts.

    part1: T1
    The first key part.
    part2: T2
    The second key part.
    part3: T3
    The third key part.
    part4: T4
    The fourth key part.

    Returns: A new `CompositeCorrelationKey` instance.

    Type parameters: T1: The type of the first key part.; T2: The type of the second key part.; T3: The type of the third key part.; T4: The type of the fourth key part.

  • methodFrom<T1, T2, T3>
    public static CompositeCorrelationKey From<T1, T2, T3>(T1 part1, T2 part2, T3 part3) where T1 : notnull where T2 : notnull where T3 : notnull

    Creates a new composite correlation key from three strongly typed parts.

    part1: T1
    The first key part.
    part2: T2
    The second key part.
    part3: T3
    The third key part.

    Returns: A new `CompositeCorrelationKey` instance.

    Type parameters: T1: The type of the first key part.; T2: The type of the second key part.; T3: The type of the third key part.

  • methodFrom<T1, T2>
    public static CompositeCorrelationKey From<T1, T2>(T1 part1, T2 part2) where T1 : notnull where T2 : notnull

    Creates a new composite correlation key from two strongly typed parts.

    part1: T1
    The first key part.
    part2: T2
    The second key part.

    Returns: A new `CompositeCorrelationKey` instance.

    Type parameters: T1: The type of the first key part.; T2: The type of the second key part.

  • methodToCorrelationId
    public CorrelationId ToCorrelationId()

    Converts this composite correlation key into a deterministic `CorrelationId`.

    Returns: A deterministic `CorrelationId` generated via SHA-256 hashing.

  • methodToString
    public override string ToString()

    Inherits documentation from base type or interface.

  • propertyValue
    public string Value { get; }

    Gets the normalized combined key string value.

class

ConcurrencyConflictException

Assembly: EricksonLopez.Processes.Abstractions
public sealed class ConcurrencyConflictException : ProcessException
Inherits: ProcessException

Represents errors caused by an optimistic concurrency conflict during process persistence.

Members (5)

  • constructorConcurrencyConflictException
    public ConcurrencyConflictException()

    Initializes a new instance of the `ConcurrencyConflictException` class.

  • constructorConcurrencyConflictException
    public ConcurrencyConflictException(ProcessId processId, Revision expectedRevision)

    Initializes a new instance of the `ConcurrencyConflictException` class with the specified process identifier and expected revision.

    processId: ProcessId
    The unique process identifier.
    expectedRevision: Revision
    The expected revision token.
  • constructorConcurrencyConflictException
    public ConcurrencyConflictException(string message)

    Initializes a new instance of the `ConcurrencyConflictException` class with a specified error message.

    message: string
    The message that describes the error.
  • constructorConcurrencyConflictException
    public ConcurrencyConflictException(string message, Exception? innerException)

    Initializes a new instance of the `ConcurrencyConflictException` class with a specified error message and inner exception.

    message: string
    The error message that explains the reason for the exception.
    innerException: Exception?
    The exception that is the cause of the current exception, or `null`.
  • propertyExpectedRevision
    public Revision ExpectedRevision { get; }

    Gets the revision expected by the storage persistence operation.

record

CorrelationId

Assembly: EricksonLopez.Processes.Abstractions
public readonly record struct CorrelationId : IComparable<CorrelationId>, IComparable, ISpanFormattable, ISpanParsable<CorrelationId>, IUtf8SpanParsable<CorrelationId>
Implements: IComparable, IComparable<CorrelationId>, ISpanFormattable, ISpanParsable<CorrelationId>, IUtf8SpanParsable<CorrelationId>

Represents a strongly typed identifier for the overarching business transaction or conversation thread.

Members (27)

  • constructorCorrelationId
    public CorrelationId(string value)

    Initializes a new instance of the `CorrelationId` struct with the specified string value.

    value: string
    The correlation identifier string.

    Exceptions: ArgumentException: `value` is `null` or white-space

  • methodCompareTo
    public int CompareTo(CorrelationId other)

    Inherits documentation from base type or interface.

    other: CorrelationId
  • methodCompareTo
    public int CompareTo(object? obj)

    Inherits documentation from base type or interface.

    obj: object?
  • methodFrom
    public static CorrelationId From(Guid value)

    Creates a `CorrelationId` from the specified `Guid`.

    value: Guid
    The unique identifier GUID.

    Returns: A new `CorrelationId` instance.

  • methodFrom
    public static CorrelationId From(string value)

    Creates a `CorrelationId` from the specified string.

    value: string
    The correlation identifier string.

    Returns: A new `CorrelationId` instance.

    Exceptions: ArgumentException: `value` is `null` or white-space

  • methodFromGuid
    public static CorrelationId FromGuid(Guid value)

    Creates a `CorrelationId` from the specified `Guid`.

    value: Guid
    The unique identifier GUID.

    Returns: A new `CorrelationId` instance.

  • methodFromString
    public static CorrelationId FromString(string value)

    Creates a `CorrelationId` from the specified string.

    value: string
    The correlation identifier string.

    Returns: A new `CorrelationId` instance.

    Exceptions: ArgumentException: `value` is `null` or white-space

  • methodNewId
    public static CorrelationId NewId()

    Creates a new `CorrelationId` from a time-ordered UUIDv7.

    Returns: A new `CorrelationId` instance.

  • methodParse
    public static CorrelationId Parse(ReadOnlySpan<byte> utf8Text)

    Parses a span of UTF-8 bytes into a `CorrelationId`.

    utf8Text: ReadOnlySpan<byte>
    The span of UTF-8 bytes to parse.

    Returns: The parsed `CorrelationId`.

  • methodParse
    public static CorrelationId Parse(ReadOnlySpan<byte> utf8Text, IFormatProvider? provider)

    Inherits documentation from base type or interface.

    utf8Text: ReadOnlySpan<byte>
    provider: IFormatProvider?
  • methodParse
    public static CorrelationId Parse(ReadOnlySpan<char> s)

    Parses a span of characters into a `CorrelationId`.

    s: ReadOnlySpan<char>
    The span of characters to parse.

    Returns: The parsed `CorrelationId`.

    Exceptions: ArgumentException: `s` is empty or white-space

  • methodParse
    public static CorrelationId Parse(ReadOnlySpan<char> s, IFormatProvider? provider)

    Inherits documentation from base type or interface.

    s: ReadOnlySpan<char>
    provider: IFormatProvider?
  • methodParse
    public static CorrelationId Parse(string s)

    Parses a string into a `CorrelationId`.

    s: string
    The string to parse.

    Returns: The parsed `CorrelationId`.

  • methodParse
    public static CorrelationId Parse(string s, IFormatProvider? provider)

    Inherits documentation from base type or interface.

    s: string
    provider: IFormatProvider?
  • methodToString
    public override string ToString()

    Inherits documentation from base type or interface.

  • methodToString
    public string ToString(string? format, IFormatProvider? formatProvider)

    Inherits documentation from base type or interface.

    format: string?
    formatProvider: IFormatProvider?
  • methodTryFormat
    public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider)

    Inherits documentation from base type or interface.

    destination: Span<char>
    charsWritten: out int
    format: ReadOnlySpan<char>
    provider: IFormatProvider?
  • methodTryParse
    public static bool TryParse(ReadOnlySpan<byte> utf8Text, IFormatProvider? provider, out CorrelationId result)

    Inherits documentation from base type or interface.

    utf8Text: ReadOnlySpan<byte>
    provider: IFormatProvider?
    result: out CorrelationId
  • methodTryParse
    public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out CorrelationId result)

    Inherits documentation from base type or interface.

    s: ReadOnlySpan<char>
    provider: IFormatProvider?
    result: out CorrelationId
  • methodTryParse
    public static bool TryParse(string? s, IFormatProvider? provider, out CorrelationId result)

    Inherits documentation from base type or interface.

    s: string?
    provider: IFormatProvider?
    result: out CorrelationId
  • methodexplicit operator CorrelationId
    public static explicit operator CorrelationId(string value)

    Converts a string to a `CorrelationId` instance.

    value: string
    The correlation identifier string.

    Exceptions: ArgumentException: `value` is `null` or white-space

  • methodimplicit operator string
    public static implicit operator string(CorrelationId id)

    Converts a `CorrelationId` to its underlying string representation.

    id: CorrelationId
    The correlation identifier to convert.
  • methodoperator <
    public static bool operator <(CorrelationId left, CorrelationId right)

    Determines whether one `CorrelationId` instance is less than another.

    left: CorrelationId
    The first correlation identifier to compare.
    right: CorrelationId
    The second correlation identifier to compare.

    Returns: `true` if `left` is less than `right`; otherwise, `false`.

  • methodoperator <=
    public static bool operator <=(CorrelationId left, CorrelationId right)

    Determines whether one `CorrelationId` instance is less than or equal to another.

    left: CorrelationId
    The first correlation identifier to compare.
    right: CorrelationId
    The second correlation identifier to compare.

    Returns: `true` if `left` is less than or equal to `right`; otherwise, `false`.

  • methodoperator >
    public static bool operator >(CorrelationId left, CorrelationId right)

    Determines whether one `CorrelationId` instance is greater than another.

    left: CorrelationId
    The first correlation identifier to compare.
    right: CorrelationId
    The second correlation identifier to compare.

    Returns: `true` if `left` is greater than `right`; otherwise, `false`.

  • methodoperator >=
    public static bool operator >=(CorrelationId left, CorrelationId right)

    Determines whether one `CorrelationId` instance is greater than or equal to another.

    left: CorrelationId
    The first correlation identifier to compare.
    right: CorrelationId
    The second correlation identifier to compare.

    Returns: `true` if `left` is greater than or equal to `right`; otherwise, `false`.

  • propertyValue
    public string Value { get; }

    Gets the string value of the correlation identifier.

interface

ICompensationHandler<TState>

Assembly: EricksonLopez.Processes.Abstractions
public interface ICompensationHandler<TState> where TState : notnull

Defines a contract for executing compensation logic for a previously completed saga step.

Remarks:

Type parameters: TState: The domain state type.

Members (1)

  • methodCompensateAsync
    ValueTask<ProcessTransitionResult<TState>> CompensateAsync(TState state, CompensationAction action, ProcessContext context)

    Executes compensation logic for the specified compensation action and payload.

    state: TState
    The current saga state.
    action: CompensationAction
    The compensation action containing the step name and payload.
    context: ProcessContext
    The process execution context.

    Returns: A value task representing the asynchronous operation. The task result contains the resulting process state transition.

interface

IProcessCoordinator<TState>

Assembly: EricksonLopez.Processes.Abstractions
public interface IProcessCoordinator<TState> where TState : notnull

Defines the application-facing contract for coordinating stateful process transitions, saga compensations, and durable persistence.

Remarks:

Type parameters: TState: The domain state type managed by the coordinator.

Members (6)

  • methodCompensateAsync<TSaga>
    ValueTask<ProcessExecutionResult<TState>> CompensateAsync<TSaga>(ProcessId processId, IReadOnlyList<CompensationStep> recordedSteps, TSaga saga, CancellationToken cancellationToken = default) where TSaga : IProcess<TState>, ICompensationHandler<TState>

    Executes reverse-order compensation steps for a saga using optimistic concurrency control.

    processId: ProcessId
    The unique process identifier of the saga to compensate.
    recordedSteps: IReadOnlyList<CompensationStep>
    The list of steps recorded during forward execution.
    saga: TSaga
    The saga instance providing compensation logic.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains the `ProcessExecutionResult<TState>`.

    Type parameters: TSaga: The saga definition and compensation handler type.

  • methodCompensateAsync<TSaga>
    ValueTask<ProcessExecutionResult<TState>> CompensateAsync<TSaga>(ProcessId processId, TSaga saga, CancellationToken cancellationToken = default) where TSaga : IProcess<TState>, ICompensationHandler<TState>

    Executes reverse-order compensation steps for a saga using optimistic concurrency control, automatically reading recorded compensation steps from the persisted process instance.

    processId: ProcessId
    The unique process identifier of the saga to compensate.
    saga: TSaga
    The saga instance providing compensation logic.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains the `ProcessExecutionResult<TState>`.

    Type parameters: TSaga: The saga definition and compensation handler type.

  • methodExecuteAsync<TEvent>
    ValueTask<ProcessExecutionResult<TState>> ExecuteAsync<TEvent>(IProcessHandler<TState, TEvent> handler, IProcessCorrelation<TEvent> correlation, TEvent eventMessage, Func<TEvent, TState>? initialStateFactory = null, bool canInitiate = false, CancellationToken cancellationToken = default)

    Executes a process handler against the targeted process instance with optimistic concurrency retries.

    handler: IProcessHandler<TState, TEvent>
    The typed process handler to invoke.
    correlation: IProcessCorrelation<TEvent>
    The correlation extractor used to obtain identifiers from the event.
    eventMessage: TEvent
    The incoming event instance to handle.
    initialStateFactory: Func<TEvent, TState>?
    The factory function to initialize state when a new instance is created.
    canInitiate: bool
    A value indicating whether this event is allowed to initiate a new process instance.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains the `ProcessExecutionResult<TState>`.

    Type parameters: TEvent: The incoming event payload type.

  • methodInitiateAsync<TEvent>
    ValueTask<ProcessExecutionResult<TState>> InitiateAsync<TEvent>(IProcessHandler<TState, TEvent> handler, IProcessCorrelation<TEvent> correlation, TEvent eventMessage, Func<TEvent, TState> initialStateFactory, CancellationToken cancellationToken = default)

    Initiates a new process instance using a required initial state factory and executes the initial message transition.

    handler: IProcessHandler<TState, TEvent>
    The typed process handler to invoke.
    correlation: IProcessCorrelation<TEvent>
    The correlation extractor used to obtain identifiers from the event.
    eventMessage: TEvent
    The incoming event instance to handle.
    initialStateFactory: Func<TEvent, TState>
    The required factory function to initialize state when a new instance is created.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains the `ProcessExecutionResult<TState>`.

    Type parameters: TEvent: The initiating event payload type.

  • methodResumeAsync<TEvent>
    ValueTask<ProcessExecutionResult<TState>> ResumeAsync<TEvent>(IProcessHandler<TState, TEvent> handler, IProcessCorrelation<TEvent> correlation, TEvent eventMessage, CancellationToken cancellationToken = default)

    Resumes an existing persisted process instance and executes the specified continuation message transition. Throws `ProcessNotFoundException` if the process instance does not exist in storage.

    handler: IProcessHandler<TState, TEvent>
    The typed process handler to invoke.
    correlation: IProcessCorrelation<TEvent>
    The correlation extractor used to obtain identifiers from the event.
    eventMessage: TEvent
    The incoming event instance to handle.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains the `ProcessExecutionResult<TState>`.

    Type parameters: TEvent: The continuation event payload type.

  • methodStartAsync<TEvent>
    ValueTask<ProcessExecutionResult<TState>> StartAsync<TEvent>(IProcessHandler<TState, TEvent> handler, IProcessCorrelation<TEvent> correlation, TEvent eventMessage, Func<TEvent, TState> initialStateFactory, CancellationToken cancellationToken = default)

    Initiates a new process instance using a required initial state factory and executes the initial message transition.

    handler: IProcessHandler<TState, TEvent>
    The typed process handler to invoke.
    correlation: IProcessCorrelation<TEvent>
    The correlation extractor used to obtain identifiers from the event.
    eventMessage: TEvent
    The incoming event instance to handle.
    initialStateFactory: Func<TEvent, TState>
    The required factory function to initialize state when a new instance is created.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains the `ProcessExecutionResult<TState>`.

    Type parameters: TEvent: The initiating event payload type.

interface

IProcessCorrelation<TEvent>

Assembly: EricksonLopez.Processes.Abstractions
public interface IProcessCorrelation<TEvent>

Defines a strongly typed correlation extractor mapping incoming events to process identifiers.

Remarks:

Type parameters: TEvent: The event type to correlate.

Members (3)

  • methodExtractCausationId
    CausationId? ExtractCausationId(TEvent event)

    Extracts the optional causation identifier from the specified event.

    event: TEvent
    The incoming event instance.

    Returns: The `CausationId` if present; otherwise, `null`.

  • methodExtractCorrelationId
    CorrelationId ExtractCorrelationId(TEvent event)

    Extracts the business correlation identifier from the specified event.

    event: TEvent
    The incoming event instance.

    Returns: The target `CorrelationId`.

  • methodExtractProcessId
    ProcessId ExtractProcessId(TEvent event)

    Extracts the process instance identifier from the specified event.

    event: TEvent
    The incoming event instance.

    Returns: The target `ProcessId`.

interface

IProcessHandler<TState, TEvent>

Assembly: EricksonLopez.Processes.Abstractions
public interface IProcessHandler<TState, TEvent> : IProcess<TState> where TState : notnull
Implements: IProcess<TState>

Defines a strongly typed handler contract for reacting to an incoming domain event within a process manager.

Remarks:

Type parameters: TState: The domain state type.; TEvent: The incoming domain event type.

Members (1)

  • methodHandleAsync
    ValueTask<ProcessTransitionResult<TState>> HandleAsync(TState state, TEvent eventMessage, ProcessContext context)

    Handles the incoming event message, producing the resulting updated state and emitted effects.

    state: TState
    The current process state.
    eventMessage: TEvent
    The incoming event payload.
    context: ProcessContext
    The process execution context.

    Returns: A value task representing the asynchronous operation. The task result contains the state transition result.

interface

IProcessState

Assembly: EricksonLopez.Processes.Abstractions
public interface IProcessState

Defines a marker interface representing the domain state schema of a process instance.

Remarks:

State implementations should be immutable C# records or readonly structs.

Members (0)

This type declares 0 public members (e.g. marker interface or empty enum/record).

interface

IProcessStateMigrator<TFrom, TTo>

Assembly: EricksonLopez.Processes.Abstractions
public interface IProcessStateMigrator<TFrom, TTo> where TFrom : notnull where TTo : notnull

Defines a contract for migrating process state from a source schema to a target schema version.

Remarks:

Type parameters: TFrom: The source state schema type.; TTo: The destination state schema type.

Members (3)

  • methodMigrate
    TTo Migrate(TFrom sourceState)

    Migrates the specified source state to the target schema.

    sourceState: TFrom
    The source state instance to migrate.

    Returns: The migrated state instance conforming to the target schema.

  • propertyFromVersion
    ProcessVersion FromVersion { get; }

    Gets the source schema version.

  • propertyToVersion
    ProcessVersion ToVersion { get; }

    Gets the target schema version.

interface

IProcessStateSerializer<TState>

Assembly: EricksonLopez.Processes.Abstractions
public interface IProcessStateSerializer<TState> where TState : notnull

Defines a contract for serializing and deserializing process domain state instances.

Remarks:

Type parameters: TState: The process domain state type.

Members (2)

  • methodDeserialize
    TState Deserialize(ReadOnlySpan<byte> data)

    Deserializes the byte span into a process state instance.

    data: ReadOnlySpan<byte>
    The serialized byte span to deserialize.

    Returns: The deserialized process state instance.

  • methodSerialize
    byte[] Serialize(TState state)

    Serializes the specified state instance into a byte array.

    state: TState
    The process state instance to serialize.

    Returns: The serialized byte array.

interface

IProcessStore<TState>

Assembly: EricksonLopez.Processes.Abstractions
public interface IProcessStore<TState> where TState : notnull

Defines the persistence contract for loading, querying, and saving process instances in durable storage.

Remarks:

Type parameters: TState: The process domain state type.

Members (5)

  • methodBeginConnectionScopeAsync
    ValueTask<IAsyncDisposable?> BeginConnectionScopeAsync(CancellationToken cancellationToken = default)

    Begins an optional connection-leasing scope across an execution or retry cycle to avoid connection pool churn.

    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains an `IAsyncDisposable` scope, or `null` if connection scoping is not used by the store.

  • methodExistsAsync
    ValueTask<bool> ExistsAsync(ProcessId id, CancellationToken cancellationToken = default)

    Determines whether a process instance with the specified identifier exists in storage.

    id: ProcessId
    The unique process identifier.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains `true` if the instance exists; otherwise, `false`.

  • methodGetByCorrelationIdAsync
    ValueTask<ProcessInstance<TState>?> GetByCorrelationIdAsync(CorrelationId correlationId, CancellationToken cancellationToken = default)

    Retrieves a process instance by its business correlation identifier.

    correlationId: CorrelationId
    The business correlation identifier.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains the matching `ProcessInstance<TState>`, or `null` if not found.

  • methodGetByIdAsync
    ValueTask<ProcessInstance<TState>?> GetByIdAsync(ProcessId id, CancellationToken cancellationToken = default)

    Retrieves a process instance by its unique identifier.

    id: ProcessId
    The unique process identifier.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains the persisted `ProcessInstance<TState>`, or `null` if not found.

  • methodSaveAsync
    ValueTask<ProcessSaveResult> SaveAsync(ProcessInstance<TState> instance, CancellationToken cancellationToken = default)

    Persists a new or updated process instance using optimistic concurrency control.

    instance: ProcessInstance<TState>
    The process instance to save.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains a `ProcessSaveResult` indicating the outcome.

interface

IProcess<TState>

Assembly: EricksonLopez.Processes.Abstractions
public interface IProcess<TState> where TState : notnull

Defines the core contract for a Process Manager definition.

Remarks:

Type parameters: TState: The domain state type.

Members (2)

  • propertyType
    ProcessType Type { get; }

    Gets the unique logical process type identity.

  • propertyVersion
    ProcessVersion Version { get; }

    Gets the schema or definition version of this process.

interface

ISagaSnapshotRepository<TState>

Assembly: EricksonLopez.Processes.Abstractions
public interface ISagaSnapshotRepository<TState> where TState : notnull

Defines the snapshot storage contract for capturing and restoring process state checkpoints.

Remarks:

Type parameters: TState: The process state type.

Members (2)

  • methodGetLatestSnapshotAsync
    ValueTask<(Revision Revision, TState State)?> GetLatestSnapshotAsync(ProcessId processId, CancellationToken cancellationToken = default)

    Retrieves the most recent snapshot checkpoint for the given process identifier.

    processId: ProcessId
    The unique process identifier.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains the latest snapshot tuple of revision and state, or `null` if no snapshot exists.

  • methodSaveSnapshotAsync
    ValueTask SaveSnapshotAsync(ProcessId processId, Revision revision, TState state, CancellationToken cancellationToken = default)

    Saves a snapshot checkpoint of the process state.

    processId: ProcessId
    The unique process identifier.
    revision: Revision
    The revision at which the snapshot was captured.
    state: TState
    The state instance to snapshot.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation.

interface

ISaga<TState>

Assembly: EricksonLopez.Processes.Abstractions
public interface ISaga<TState> : IProcess<TState> where TState : notnull
Implements: IProcess<TState>

Defines a saga orchestration contract with support for explicit step compensation.

Remarks:

Type parameters: TState: The domain state type.

Members (0)

This type declares 0 public members (e.g. marker interface or empty enum/record).

class

InvalidProcessTransitionException

Assembly: EricksonLopez.Processes.Abstractions
public sealed class InvalidProcessTransitionException : ProcessException
Inherits: ProcessException

Represents errors caused by attempting an invalid or forbidden process state transition.

Members (6)

  • constructorInvalidProcessTransitionException
    public InvalidProcessTransitionException()

    Initializes a new instance of the `InvalidProcessTransitionException` class.

  • constructorInvalidProcessTransitionException
    public InvalidProcessTransitionException(ProcessId processId, ProcessStatus currentStatus, ProcessStatus attemptedStatus, string reason)

    Initializes a new instance of the `InvalidProcessTransitionException` class with transition status details.

    processId: ProcessId
    The unique process identifier.
    currentStatus: ProcessStatus
    The current status of the process.
    attemptedStatus: ProcessStatus
    The attempted target status.
    reason: string
    The explanation for why the transition is invalid.
  • constructorInvalidProcessTransitionException
    public InvalidProcessTransitionException(string message)

    Initializes a new instance of the `InvalidProcessTransitionException` class with a specified error message.

    message: string
    The message that describes the error.
  • constructorInvalidProcessTransitionException
    public InvalidProcessTransitionException(string message, Exception? innerException)

    Initializes a new instance of the `InvalidProcessTransitionException` class with a specified error message and inner exception.

    message: string
    The error message that explains the reason for the exception.
    innerException: Exception?
    The exception that is the cause of the current exception, or `null`.
  • propertyAttemptedStatus
    public ProcessStatus AttemptedStatus { get; }

    Gets the target lifecycle status that was attempted.

  • propertyCurrentStatus
    public ProcessStatus CurrentStatus { get; }

    Gets the current lifecycle status of the process instance.

record

MessageId

Assembly: EricksonLopez.Processes.Abstractions
public readonly record struct MessageId : IComparable<MessageId>, IComparable, ISpanFormattable, ISpanParsable<MessageId>, IUtf8SpanParsable<MessageId>
Implements: IComparable, IComparable<MessageId>, ISpanFormattable, ISpanParsable<MessageId>, IUtf8SpanParsable<MessageId>

Represents a strongly typed unique identifier for a specific message, command, or event instance.

Members (26)

  • constructorMessageId
    public MessageId(string value)

    Initializes a new instance of the `MessageId` struct with the specified string value.

    value: string
    The message identifier string.

    Exceptions: ArgumentException: `value` is `null` or white-space

  • methodCompareTo
    public int CompareTo(MessageId other)

    Inherits documentation from base type or interface.

    other: MessageId
  • methodCompareTo
    public int CompareTo(object? obj)

    Inherits documentation from base type or interface.

    obj: object?
  • methodFrom
    public static MessageId From(string value)

    Creates a `MessageId` from the specified string.

    value: string
    The message identifier string.

    Returns: A new `MessageId` instance.

    Exceptions: ArgumentException: `value` is `null` or white-space

  • methodFromGuid
    public static MessageId FromGuid(Guid value)

    Creates a `MessageId` from the specified `Guid`.

    value: Guid
    The unique identifier GUID.

    Returns: A new `MessageId` instance.

  • methodFromString
    public static MessageId FromString(string value)

    Creates a `MessageId` from the specified string.

    value: string
    The message identifier string.

    Returns: A new `MessageId` instance.

    Exceptions: ArgumentException: `value` is `null` or white-space

  • methodNewId
    public static MessageId NewId()

    Creates a new `MessageId` from a time-ordered UUIDv7.

    Returns: A new `MessageId` instance.

  • methodParse
    public static MessageId Parse(ReadOnlySpan<byte> utf8Text)

    Parses a span of UTF-8 bytes into a `MessageId`.

    utf8Text: ReadOnlySpan<byte>
    The span of UTF-8 bytes to parse.

    Returns: The parsed `MessageId`.

  • methodParse
    public static MessageId Parse(ReadOnlySpan<byte> utf8Text, IFormatProvider? provider)

    Inherits documentation from base type or interface.

    utf8Text: ReadOnlySpan<byte>
    provider: IFormatProvider?
  • methodParse
    public static MessageId Parse(ReadOnlySpan<char> s)

    Parses a span of characters into a `MessageId`.

    s: ReadOnlySpan<char>
    The span of characters to parse.

    Returns: The parsed `MessageId`.

    Exceptions: ArgumentException: `s` is empty or white-space

  • methodParse
    public static MessageId Parse(ReadOnlySpan<char> s, IFormatProvider? provider)

    Inherits documentation from base type or interface.

    s: ReadOnlySpan<char>
    provider: IFormatProvider?
  • methodParse
    public static MessageId Parse(string s)

    Parses a string into a `MessageId`.

    s: string
    The string to parse.

    Returns: The parsed `MessageId`.

  • methodParse
    public static MessageId Parse(string s, IFormatProvider? provider)

    Inherits documentation from base type or interface.

    s: string
    provider: IFormatProvider?
  • methodToString
    public override string ToString()

    Inherits documentation from base type or interface.

  • methodToString
    public string ToString(string? format, IFormatProvider? formatProvider)

    Inherits documentation from base type or interface.

    format: string?
    formatProvider: IFormatProvider?
  • methodTryFormat
    public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider)

    Inherits documentation from base type or interface.

    destination: Span<char>
    charsWritten: out int
    format: ReadOnlySpan<char>
    provider: IFormatProvider?
  • methodTryParse
    public static bool TryParse(ReadOnlySpan<byte> utf8Text, IFormatProvider? provider, out MessageId result)

    Inherits documentation from base type or interface.

    utf8Text: ReadOnlySpan<byte>
    provider: IFormatProvider?
    result: out MessageId
  • methodTryParse
    public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out MessageId result)

    Inherits documentation from base type or interface.

    s: ReadOnlySpan<char>
    provider: IFormatProvider?
    result: out MessageId
  • methodTryParse
    public static bool TryParse(string? s, IFormatProvider? provider, out MessageId result)

    Inherits documentation from base type or interface.

    s: string?
    provider: IFormatProvider?
    result: out MessageId
  • methodexplicit operator MessageId
    public static explicit operator MessageId(string value)

    Converts a string to a `MessageId` instance.

    value: string
    The message identifier string.

    Exceptions: ArgumentException: `value` is `null` or white-space

  • methodimplicit operator string
    public static implicit operator string(MessageId id)

    Converts a `MessageId` to its underlying string representation.

    id: MessageId
    The message identifier to convert.
  • methodoperator <
    public static bool operator <(MessageId left, MessageId right)

    Determines whether one `MessageId` instance is less than another.

    left: MessageId
    The first message identifier to compare.
    right: MessageId
    The second message identifier to compare.

    Returns: `true` if `left` is less than `right`; otherwise, `false`.

  • methodoperator <=
    public static bool operator <=(MessageId left, MessageId right)

    Determines whether one `MessageId` instance is less than or equal to another.

    left: MessageId
    The first message identifier to compare.
    right: MessageId
    The second message identifier to compare.

    Returns: `true` if `left` is less than or equal to `right`; otherwise, `false`.

  • methodoperator >
    public static bool operator >(MessageId left, MessageId right)

    Determines whether one `MessageId` instance is greater than another.

    left: MessageId
    The first message identifier to compare.
    right: MessageId
    The second message identifier to compare.

    Returns: `true` if `left` is greater than `right`; otherwise, `false`.

  • methodoperator >=
    public static bool operator >=(MessageId left, MessageId right)

    Determines whether one `MessageId` instance is greater than or equal to another.

    left: MessageId
    The first message identifier to compare.
    right: MessageId
    The second message identifier to compare.

    Returns: `true` if `left` is greater than or equal to `right`; otherwise, `false`.

  • propertyValue
    public string Value { get; }

    Gets the string value of the message identifier.

record

PersistedCompensationStepRecord

Assembly: EricksonLopez.Processes.Abstractions
public sealed record PersistedCompensationStepRecord(string StepName, DateTimeOffset RecordedAt, string? ContextPayload, string? FailureReason, DateTimeOffset? FailedAt)

Represents the wire-level persistence record for a single `CompensationStep`.

Members (6)

  • constructorPersistedCompensationStepRecord
    public PersistedCompensationStepRecord(string StepName, DateTimeOffset RecordedAt, string? ContextPayload, string? FailureReason = null, DateTimeOffset? FailedAt = null)

    Initializes a new instance of PersistedCompensationStepRecord.

    StepName: string
    The logical name of the compensation step.
    RecordedAt: DateTimeOffset
    The UTC timestamp when the step was recorded.
    ContextPayload: string?
    The optional contextual metadata payload.
    FailureReason: string?
    The optional failure reason if the compensation step failed.
    FailedAt: DateTimeOffset?
    The optional UTC timestamp when the compensation step failed.
  • propertyContextPayload
    public string? ContextPayload { get; init; }

    The optional contextual metadata payload.

  • propertyFailedAt
    public DateTimeOffset? FailedAt { get; init; }

    The optional UTC timestamp when the compensation step failed.

  • propertyFailureReason
    public string? FailureReason { get; init; }

    The optional failure reason if the compensation step failed.

  • propertyRecordedAt
    public DateTimeOffset RecordedAt { get; init; }

    The UTC timestamp when the step was recorded.

  • propertyStepName
    public string StepName { get; init; }

    The logical name of the compensation step.

class

ProcessContext

Assembly: EricksonLopez.Processes.Abstractions
public sealed class ProcessContext

Provides contextual execution metadata and services to a process handler or saga step.

Members (10)

  • constructorProcessContext
    public ProcessContext(ProcessId processId, CorrelationId correlationId, CausationId causationId, MessageId messageId, DateTimeOffset now, TimeProvider? timeProvider = null, IReadOnlyDictionary<string, object?>? items = null, CancellationToken cancellationToken = default)

    Initializes a new instance of the `ProcessContext` class with the specified metadata and services.

    processId: ProcessId
    The unique process identifier.
    correlationId: CorrelationId
    The business correlation identifier.
    causationId: CausationId
    The causation identifier of the trigger message.
    messageId: MessageId
    The unique message identifier.
    now: DateTimeOffset
    The UTC timestamp when execution began.
    timeProvider: TimeProvider?
    The optional time provider instance, or `null` to use `TimeProvider.System`.
    items: IReadOnlyDictionary<string, object?>?
    The optional contextual items dictionary, or `null`.
    cancellationToken: CancellationToken
    A token that can be used to cancel the execution step.
  • methodCreate
    public static ProcessContext Create(ProcessId processId, CorrelationId correlationId, CausationId? causationId = null, MessageId? messageId = null, TimeProvider? timeProvider = null, IReadOnlyDictionary<string, object?>? items = null, CancellationToken cancellationToken = default)

    Creates a new `ProcessContext` with defaults for optional message identifiers and timestamps.

    processId: ProcessId
    The unique process identifier.
    correlationId: CorrelationId
    The business correlation identifier.
    causationId: CausationId?
    The optional causation identifier, or `null` to derive from the message identifier.
    messageId: MessageId?
    The optional message identifier, or `null` to generate a new time-ordered identifier.
    timeProvider: TimeProvider?
    The optional time provider instance, or `null` to use `TimeProvider.System`.
    items: IReadOnlyDictionary<string, object?>?
    The optional contextual items dictionary, or `null`.
    cancellationToken: CancellationToken
    A token that can be used to cancel the execution step.

    Returns: A new `ProcessContext` instance.

  • propertyCancellationToken
    public CancellationToken CancellationToken { get; }

    Gets the cancellation token for the current execution step.

  • propertyCausationId
    public CausationId CausationId { get; }

    Gets the causation identifier of the trigger message.

  • propertyCorrelationId
    public CorrelationId CorrelationId { get; }

    Gets the overarching business correlation identifier.

  • propertyItems
    public IReadOnlyDictionary<string, object?> Items { get; }

    Gets contextual key-value items passed into this execution.

  • propertyMessageId
    public MessageId MessageId { get; }

    Gets the unique identifier of the incoming message.

  • propertyNow
    public DateTimeOffset Now { get; }

    Gets the deterministic UTC timestamp when execution began.

  • propertyProcessId
    public ProcessId ProcessId { get; }

    Gets the unique identifier of the process instance.

  • propertyTimeProvider
    public TimeProvider TimeProvider { get; }

    Gets the time provider for timestamp and delay calculations.

class

ProcessDefinitionAttribute

Assembly: EricksonLopez.Processes.Abstractions
public sealed class ProcessDefinitionAttribute : Attribute
Inherits: Attribute

Specifies that a class is a process manager definition discovered for compile-time registration.

Members (3)

  • constructorProcessDefinitionAttribute
    public ProcessDefinitionAttribute(string processType, int version = 1)

    Initializes a new instance of the `ProcessDefinitionAttribute` class with the specified process type and version.

    processType: string
    The logical process type identifier.
    version: int
    The schema or definition version number.

    Exceptions: ArgumentException: `processType` is `null` or white-space

  • propertyProcessType
    public string ProcessType { get; }

    Gets the unique logical process type identifier.

  • propertyVersion
    public int Version { get; }

    Gets the schema or definition version number.

record

ProcessEffect

Assembly: EricksonLopez.Processes.Abstractions
public abstract record ProcessEffect

Represents an outbound side-effect intent produced by a process state transition.

Members (5)

  • methodCreateCommand<T>
    public static Command CreateCommand<T>(T payload, string? commandType = null) where T : notnull

    Creates a new `Command` effect with the specified payload and command type.

    payload: T
    The command payload instance.
    commandType: string?
    The optional logical command type name.

    Returns: A new `Command` effect instance.

    Type parameters: T: The command payload type.

  • methodCreateCompensation
    public static Compensation CreateCompensation(CompensationAction action)

    Creates a new `Compensation` effect with the specified action.

    action: CompensationAction
    The compensation action details.

    Returns: A new `Compensation` effect instance.

  • methodCreateCompensation<T>
    public static Compensation CreateCompensation<T>(string stepName, T payload) where T : notnull

    Creates a new `Compensation` effect with the specified step name and payload.

    stepName: string
    The unique logical name of the step to compensate.
    payload: T
    The compensation action payload.

    Returns: A new `Compensation` effect instance.

    Type parameters: T: The compensation payload type.

  • methodCreateEvent<T>
    public static Event CreateEvent<T>(T payload, string? eventType = null) where T : notnull

    Creates a new `Event` effect with the specified payload and event type.

    payload: T
    The event payload instance.
    eventType: string?
    The optional logical event type name.

    Returns: A new `Event` effect instance.

    Type parameters: T: The event payload type.

  • methodCreateTimeout<T>
    public static ScheduleTimeout CreateTimeout<T>(TimeSpan delay, T trigger, string? triggerType = null) where T : notnull

    Creates a new `ScheduleTimeout` effect with the specified delay, trigger, and trigger type.

    delay: TimeSpan
    The duration before the timeout expires.
    trigger: T
    The trigger payload to deliver when the timeout expires.
    triggerType: string?
    The optional logical trigger type name.

    Returns: A new `ScheduleTimeout` effect instance.

    Type parameters: T: The trigger payload type.

record

ProcessEffect.Command

Assembly: EricksonLopez.Processes.Abstractions
public sealed record Command(object CommandPayload, string? CommandType) : ProcessEffect
Inherits: ProcessEffect

Represents an intent to issue an asynchronous command.

Remarks:

Exceptions: ArgumentNullException: `CommandPayload` is `null`

Members (5)

  • constructorCommand
    public Command(object CommandPayload, string? CommandType = null)

    Initializes a new instance of Command.

    CommandPayload: object
    The command payload object.
    CommandType: string?
    Optional logical type name of the command.

    Exceptions: ArgumentNullException: `CommandPayload` is `null`

  • methodGetPayload<T>
    public T GetPayload<T>()

    Gets the command payload cast to the specified type.

    Returns: The cast command instance.

    Type parameters: T: The expected command type. Exceptions: InvalidCastException: The payload is not of type `T`. Use `TryGetPayload<T>` for a safe alternative

  • methodTryGetPayload<T>
    public bool TryGetPayload<T>(out T? payload)

    Attempts to get the command payload as the specified type.

    payload: out T?
    When this method returns, contains the command payload if of type `T`; otherwise, the default value for `T`.

    Returns: `true` if the payload is of type `T`; otherwise, `false`.

    Type parameters: T: The expected command type.

  • propertyCommandPayload
    public object CommandPayload { get; init; }

    Gets the command payload object.

  • propertyCommandType
    public string? CommandType { get; init; }

    Optional logical type name of the command.

record

ProcessEffect.Compensation

Assembly: EricksonLopez.Processes.Abstractions
public sealed record Compensation(CompensationAction Action) : ProcessEffect
Inherits: ProcessEffect

Represents an intent to execute a compensating action.

Remarks:

Exceptions: ArgumentNullException: `Action` is `null`

Members (2)

  • constructorCompensation
    public Compensation(CompensationAction Action)

    Initializes a new instance of Compensation.

    Action: CompensationAction
    The compensation action details.

    Exceptions: ArgumentNullException: `Action` is `null`

  • propertyAction
    public CompensationAction Action { get; init; }

    Gets the compensation action details.

record

ProcessEffect.Event

Assembly: EricksonLopez.Processes.Abstractions
public sealed record Event(object EventPayload, string? EventType) : ProcessEffect
Inherits: ProcessEffect

Represents an intent to publish an outbound domain or integration event.

Remarks:

Exceptions: ArgumentNullException: `EventPayload` is `null`

Members (5)

  • constructorEvent
    public Event(object EventPayload, string? EventType = null)

    Initializes a new instance of Event.

    EventPayload: object
    The event payload object.
    EventType: string?
    Optional logical type name of the event.

    Exceptions: ArgumentNullException: `EventPayload` is `null`

  • methodGetPayload<T>
    public T GetPayload<T>()

    Gets the event payload cast to the specified type.

    Returns: The cast event instance.

    Type parameters: T: The expected event type. Exceptions: InvalidCastException: The payload is not of type `T`. Use `TryGetPayload<T>` for a safe alternative

  • methodTryGetPayload<T>
    public bool TryGetPayload<T>(out T? payload)

    Attempts to get the event payload as the specified type.

    payload: out T?
    When this method returns, contains the event payload if of type `T`; otherwise, the default value for `T`.

    Returns: `true` if the payload is of type `T`; otherwise, `false`.

    Type parameters: T: The expected event type.

  • propertyEventPayload
    public object EventPayload { get; init; }

    Gets the event payload object.

  • propertyEventType
    public string? EventType { get; init; }

    Optional logical type name of the event.

record

ProcessEffect.ScheduleTimeout

Assembly: EricksonLopez.Processes.Abstractions
public sealed record ScheduleTimeout(TimeSpan Delay, object TimeoutTrigger, string? TriggerType) : ProcessEffect
Inherits: ProcessEffect

Represents an intent to schedule a timeout or wake-up trigger after a duration.

Remarks:

Exceptions: ArgumentNullException: `TimeoutTrigger` is `null`

Members (6)

  • constructorScheduleTimeout
    public ScheduleTimeout(TimeSpan Delay, object TimeoutTrigger, string? TriggerType = null)

    Initializes a new instance of ScheduleTimeout.

    Delay: TimeSpan
    The duration to wait before triggering the timeout.
    TimeoutTrigger: object
    The trigger payload to deliver when the timeout expires.
    TriggerType: string?
    Optional logical type of the trigger.

    Exceptions: ArgumentNullException: `TimeoutTrigger` is `null`

  • methodGetTrigger<T>
    public T GetTrigger<T>()

    Gets the timeout trigger payload cast to the specified type.

    Returns: The cast trigger instance.

    Type parameters: T: The expected trigger type.

  • methodTryGetTrigger<T>
    public bool TryGetTrigger<T>(out T? trigger)

    Attempts to get the timeout trigger payload as the specified type.

    trigger: out T?
    When this method returns, contains the trigger payload if of type `T`; otherwise, the default value for `T`.

    Returns: `true` if the trigger is of type `T`; otherwise, `false`.

    Type parameters: T: The expected trigger type.

  • propertyDelay
    public TimeSpan Delay { get; init; }

    The duration to wait before triggering the timeout.

  • propertyTimeoutTrigger
    public object TimeoutTrigger { get; init; }

    Gets the timeout trigger payload object.

  • propertyTriggerType
    public string? TriggerType { get; init; }

    Optional logical type of the trigger.

class

ProcessException

Assembly: EricksonLopez.Processes.Abstractions
public class ProcessException : Exception
Inherits: Exception

Represents errors that occur during process manager or saga execution.

Members (5)

  • constructorProcessException
    public ProcessException()

    Initializes a new instance of the `ProcessException` class.

  • constructorProcessException
    public ProcessException(string message)

    Initializes a new instance of the `ProcessException` class with a specified error message.

    message: string
    The message that describes the error.
  • constructorProcessException
    public ProcessException(string message, Exception? innerException)

    Initializes a new instance of the `ProcessException` class with a specified error message and inner exception.

    message: string
    The error message that explains the reason for the exception.
    innerException: Exception?
    The exception that is the cause of the current exception, or `null`.
  • constructorProcessException
    public ProcessException(string message, ProcessId? processId, Exception? innerException = null)

    Initializes a new instance of the `ProcessException` class with a specified error message, process identifier, and inner exception.

    message: string
    The error message that explains the reason for the exception.
    processId: ProcessId?
    The process identifier associated with the exception, or `null`.
    innerException: Exception?
    The exception that is the cause of the current exception, or `null`.
  • propertyProcessId
    public ProcessId? ProcessId { get; }

    Gets the process identifier associated with the exception, if available.

record

ProcessExecutionResult<TState>

Assembly: EricksonLopez.Processes.Abstractions
public sealed record ProcessExecutionResult<TState> where TState : notnull

Represents the final result of coordinating and persisting a process step.

Remarks:

Type parameters: TState: The domain state type.

Members (10)

  • constructorProcessExecutionResult
    public ProcessExecutionResult(ProcessInstance<TState> instance, IReadOnlyList<ProcessEffect> effects, ProcessSaveResult saveResult, IReadOnlyList<CompensationStep>? recordedCompensations = null, string? failureReason = null)

    Initializes a new instance of the `ProcessExecutionResult<TState>` record with the instance, effects, and save result.

    instance: ProcessInstance<TState>
    The persisted process instance after the transition.
    effects: IReadOnlyList<ProcessEffect>
    The list of side-effect intents emitted by the transition.
    saveResult: ProcessSaveResult
    The persistence outcome resulting from saving the instance.
    recordedCompensations: IReadOnlyList<CompensationStep>?
    The optional list of compensations recorded during execution.
    failureReason: string?
    The optional failure reason when the process transitions to `ProcessStatus.Failed`.

    Exceptions: ArgumentNullException: `instance` is `null`

  • propertyEffects
    public IReadOnlyList<ProcessEffect> Effects { get; init; }

    Gets the list of side-effect intents emitted by the transition.

  • propertyFailureReason
    public string? FailureReason { get; init; }

    Gets the optional failure reason if the transition or compensation resulted in a failure.

  • propertyInstance
    public ProcessInstance<TState> Instance { get; init; }

    Gets the persisted process instance after the transition.

  • propertyIsBusinessFailure
    public bool IsBusinessFailure { get; }

    Gets a value indicating whether the process transitioned to `ProcessStatus.Failed` and that failure state was durably persisted.

  • propertyIsConcurrencyConflict
    public bool IsConcurrencyConflict { get; }

    Gets a value indicating whether the execution failed to persist due to an optimistic concurrency conflict.

  • propertyIsPersisted
    public bool IsPersisted { get; }

    Gets a value indicating whether the state was durably persisted without a storage concurrency conflict, regardless of whether the resulting business status is `ProcessStatus.Failed`.

  • propertyIsSuccess
    public bool IsSuccess { get; }

    Gets a value indicating whether both storage persistence succeeded AND the domain process did not transition to `ProcessStatus.Failed`.

  • propertyRecordedCompensations
    public IReadOnlyList<CompensationStep> RecordedCompensations { get; init; }

    Gets the list of compensations recorded by this process instance.

  • propertySaveResult
    public ProcessSaveResult SaveResult { get; init; }

    Gets the persistence outcome resulting from saving the instance.

class

ProcessHandlerAttribute

Assembly: EricksonLopez.Processes.Abstractions
public sealed class ProcessHandlerAttribute : Attribute
Inherits: Attribute

Specifies that a method handles incoming events within a process manager or saga.

Members (2)

  • constructorProcessHandlerAttribute
    public ProcessHandlerAttribute(bool canInitiate = false)

    Initializes a new instance of the `ProcessHandlerAttribute` class with the initiation capability indicator.

    canInitiate: bool
    A value indicating whether the handled event can initiate a new process instance.
  • propertyCanInitiate
    public bool CanInitiate { get; }

    Gets a value indicating whether the handled event can initiate a new process instance when none exists.

record

ProcessId

Assembly: EricksonLopez.Processes.Abstractions
public readonly record struct ProcessId : IComparable<ProcessId>, IComparable, ISpanFormattable, ISpanParsable<ProcessId>, IUtf8SpanParsable<ProcessId>
Implements: IComparable, IComparable<ProcessId>, ISpanFormattable, ISpanParsable<ProcessId>, IUtf8SpanParsable<ProcessId>

Represents a strongly typed, immutable identifier for a process instance.

Members (27)

  • constructorProcessId
    public ProcessId(Guid value)

    Initializes a new instance of the `ProcessId` struct with the specified `Guid`.

    value: Guid
    The underlying unique identifier.
  • methodCompareTo
    public int CompareTo(ProcessId other)

    Inherits documentation from base type or interface.

    other: ProcessId
  • methodCompareTo
    public int CompareTo(object? obj)

    Inherits documentation from base type or interface.

    obj: object?
  • methodFrom
    public static ProcessId From(Guid value)

    Creates a `ProcessId` from an existing `Guid`.

    value: Guid
    The underlying unique identifier GUID.

    Returns: A new `ProcessId` instance.

  • methodFromGuid
    public static ProcessId FromGuid(Guid value)

    Creates a `ProcessId` from an existing `Guid`.

    value: Guid
    The underlying unique identifier GUID.

    Returns: A new `ProcessId` instance.

  • methodNewId
    public static ProcessId NewId()

    Creates a new `ProcessId` from a time-ordered UUIDv7.

    Returns: A new unique `ProcessId`.

  • methodParse
    public static ProcessId Parse(ReadOnlySpan<byte> utf8Text)

    Parses a span of UTF-8 bytes into a `ProcessId`.

    utf8Text: ReadOnlySpan<byte>
    The span of UTF-8 bytes to parse.

    Returns: The parsed `ProcessId`.

  • methodParse
    public static ProcessId Parse(ReadOnlySpan<byte> utf8Text, IFormatProvider? provider)

    Inherits documentation from base type or interface.

    utf8Text: ReadOnlySpan<byte>
    provider: IFormatProvider?
  • methodParse
    public static ProcessId Parse(ReadOnlySpan<char> s)

    Parses a span of characters into a `ProcessId`.

    s: ReadOnlySpan<char>
    The span of characters to parse.

    Returns: The parsed `ProcessId`.

  • methodParse
    public static ProcessId Parse(ReadOnlySpan<char> s, IFormatProvider? provider)

    Inherits documentation from base type or interface.

    s: ReadOnlySpan<char>
    provider: IFormatProvider?
  • methodParse
    public static ProcessId Parse(string s)

    Parses a string into a `ProcessId`.

    s: string
    The string to parse.

    Returns: The parsed `ProcessId`.

  • methodParse
    public static ProcessId Parse(string s, IFormatProvider? provider)

    Inherits documentation from base type or interface.

    s: string
    provider: IFormatProvider?
  • methodToGuid
    public Guid ToGuid()

    Converts this instance to its underlying `Guid` value.

    Returns: The underlying `Guid` value.

  • methodToString
    public override string ToString()

    Inherits documentation from base type or interface.

  • methodToString
    public string ToString(string? format, IFormatProvider? formatProvider)

    Inherits documentation from base type or interface.

    format: string?
    formatProvider: IFormatProvider?
  • methodTryFormat
    public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider)

    Inherits documentation from base type or interface.

    destination: Span<char>
    charsWritten: out int
    format: ReadOnlySpan<char>
    provider: IFormatProvider?
  • methodTryParse
    public static bool TryParse(ReadOnlySpan<byte> utf8Text, IFormatProvider? provider, out ProcessId result)

    Inherits documentation from base type or interface.

    utf8Text: ReadOnlySpan<byte>
    provider: IFormatProvider?
    result: out ProcessId
  • methodTryParse
    public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out ProcessId result)

    Inherits documentation from base type or interface.

    s: ReadOnlySpan<char>
    provider: IFormatProvider?
    result: out ProcessId
  • methodTryParse
    public static bool TryParse(string? s, IFormatProvider? provider, out ProcessId result)

    Inherits documentation from base type or interface.

    s: string?
    provider: IFormatProvider?
    result: out ProcessId
  • methodexplicit operator ProcessId
    public static explicit operator ProcessId(Guid value)

    Converts a `Guid` to a `ProcessId` instance.

    value: Guid
    The unique identifier GUID.
  • methodimplicit operator Guid
    public static implicit operator Guid(ProcessId id)

    Converts a `ProcessId` to its underlying `Guid` value.

    id: ProcessId
    The process identifier to convert.
  • methodoperator <
    public static bool operator <(ProcessId left, ProcessId right)

    Determines whether one `ProcessId` instance is less than another.

    left: ProcessId
    The first process identifier to compare.
    right: ProcessId
    The second process identifier to compare.

    Returns: `true` if `left` is less than `right`; otherwise, `false`.

  • methodoperator <=
    public static bool operator <=(ProcessId left, ProcessId right)

    Determines whether one `ProcessId` instance is less than or equal to another.

    left: ProcessId
    The first process identifier to compare.
    right: ProcessId
    The second process identifier to compare.

    Returns: `true` if `left` is less than or equal to `right`; otherwise, `false`.

  • methodoperator >
    public static bool operator >(ProcessId left, ProcessId right)

    Determines whether one `ProcessId` instance is greater than another.

    left: ProcessId
    The first process identifier to compare.
    right: ProcessId
    The second process identifier to compare.

    Returns: `true` if `left` is greater than `right`; otherwise, `false`.

  • methodoperator >=
    public static bool operator >=(ProcessId left, ProcessId right)

    Determines whether one `ProcessId` instance is greater than or equal to another.

    left: ProcessId
    The first process identifier to compare.
    right: ProcessId
    The second process identifier to compare.

    Returns: `true` if `left` is greater than or equal to `right`; otherwise, `false`.

  • propertyEmpty
    public static ProcessId Empty { get; }

    Gets an empty `ProcessId`.

  • propertyValue
    public Guid Value { get; }

    Gets the underlying `Guid` value.

record

ProcessInstance<TState>

Assembly: EricksonLopez.Processes.Abstractions
public sealed record ProcessInstance<TState> where TState : notnull

Represents a persistent container that encapsulates execution metadata alongside the domain state.

Remarks:

Type parameters: TState: The type of the domain state.

Members (16)

  • constructorProcessInstance
    public ProcessInstance(ProcessId id, ProcessType type, ProcessVersion version, ProcessStatus status, Revision revision, CorrelationId correlationId, DateTimeOffset createdAt, DateTimeOffset updatedAt, DateTimeOffset? completedAt, TState state, IReadOnlyList<CompensationStep>? recordedCompensations = null)

    Initializes a new instance of the `ProcessInstance<TState>` record with the specified metadata and domain state.

    id: ProcessId
    The unique identifier of the process instance.
    type: ProcessType
    The logical process type identifier.
    version: ProcessVersion
    The schema or definition version.
    status: ProcessStatus
    The lifecycle execution status.
    revision: Revision
    The optimistic concurrency revision token.
    correlationId: CorrelationId
    The business correlation identifier.
    createdAt: DateTimeOffset
    The UTC creation timestamp.
    updatedAt: DateTimeOffset
    The UTC last-updated timestamp.
    completedAt: DateTimeOffset?
    The optional UTC completion timestamp.
    state: TState
    The immutable domain state payload.
    recordedCompensations: IReadOnlyList<CompensationStep>?
    The optional list of recorded compensation steps.

    Exceptions: ArgumentNullException: `state` is `null`

  • methodAdvance
    public ProcessInstance<TState> Advance(TState newState, ProcessStatus newStatus, DateTimeOffset now, IReadOnlyList<CompensationStep>? newCompensations = null, int maxCompensations = 1000)

    Advances the process instance to a new state and status with an incremented revision.

    newState: TState
    The updated domain state payload.
    newStatus: ProcessStatus
    The updated lifecycle status.
    now: DateTimeOffset
    The current UTC timestamp.
    newCompensations: IReadOnlyList<CompensationStep>?
    The optional new compensation steps recorded during this transition.
    maxCompensations: int
    The maximum allowed compensations before throwing an exception. Defaults to 1000.

    Returns: A new `ProcessInstance<TState>` record representing the advanced state.

    Exceptions: InvalidProcessTransitionException: The process instance is in a terminal status and cannot be advanced; InvalidOperationException: The number of compensations exceeded the maximum allowed

  • methodAdvanceCompensation
    public ProcessInstance<TState> AdvanceCompensation(TState newState, ProcessStatus newStatus, DateTimeOffset now, IReadOnlyList<CompensationStep>? updatedCompensations = null)

    Advances the process instance to a new state during a compensation step, updating recorded compensations.

    newState: TState
    The updated domain state payload.
    newStatus: ProcessStatus
    The updated lifecycle status.
    now: DateTimeOffset
    The current UTC timestamp.
    updatedCompensations: IReadOnlyList<CompensationStep>?
    The optional explicit list of compensation steps after this step. When `null` and status is not `ProcessStatus.Failed`, removes the last recorded step.

    Returns: A new `ProcessInstance<TState>` record representing the advanced state.

    Exceptions: InvalidProcessTransitionException: The process instance is in a terminal status and cannot be advanced

  • methodCreate
    public static ProcessInstance<TState> Create(ProcessId id, ProcessType type, ProcessVersion version, CorrelationId correlationId, TState initialState, DateTimeOffset now)

    Creates a new `ProcessInstance<TState>` in the initialized status with the initial revision.

    id: ProcessId
    The unique process identifier.
    type: ProcessType
    The logical process type identifier.
    version: ProcessVersion
    The schema or definition version.
    correlationId: CorrelationId
    The business correlation identifier.
    initialState: TState
    The initial domain state payload.
    now: DateTimeOffset
    The current UTC timestamp.

    Returns: A new `ProcessInstance<TState>` instance.

    Exceptions: ArgumentNullException: `initialState` is `null`

  • methodIsValidTransition
    public static bool IsValidTransition(ProcessStatus current, ProcessStatus next)

    Determines whether a transition from `current` to `next` is valid in the process lifecycle FSM.

    current: ProcessStatus
    The current process status.
    next: ProcessStatus
    The target process status.

    Returns: `true` if the transition is permitted; otherwise, `false`.

  • propertyCompletedAt
    public DateTimeOffset? CompletedAt { get; init; }

    Gets the UTC timestamp when the process reached a terminal status, if any.

  • propertyCorrelationId
    public CorrelationId CorrelationId { get; init; }

    Gets the business correlation identifier associated with this instance.

  • propertyCreatedAt
    public DateTimeOffset CreatedAt { get; init; }

    Gets the UTC timestamp when the process instance was created.

  • propertyId
    public ProcessId Id { get; init; }

    Gets the unique identifier of the process instance.

  • propertyRecordedCompensations
    public IReadOnlyList<CompensationStep> RecordedCompensations { get; init; }

    Gets the list of recorded compensation steps, if any.

  • propertyRevision
    public Revision Revision { get; init; }

    Gets the optimistic concurrency revision token.

  • propertyState
    public TState State { get; init; }

    Gets the immutable domain state payload.

  • propertyStatus
    public ProcessStatus Status { get; init; }

    Gets the current lifecycle status of the process instance.

  • propertyType
    public ProcessType Type { get; init; }

    Gets the logical process type identifier.

  • propertyUpdatedAt
    public DateTimeOffset UpdatedAt { get; init; }

    Gets the UTC timestamp when the process instance was last updated.

  • propertyVersion
    public ProcessVersion Version { get; init; }

    Gets the schema or definition version of the process instance.

class

ProcessNotFoundException

Assembly: EricksonLopez.Processes.Abstractions
public sealed class ProcessNotFoundException : ProcessException
Inherits: ProcessException

Represents errors caused by attempting to access a process instance that was not found in storage.

Members (5)

  • constructorProcessNotFoundException
    public ProcessNotFoundException()

    Initializes a new instance of the `ProcessNotFoundException` class.

  • constructorProcessNotFoundException
    public ProcessNotFoundException(ProcessId processId)

    Initializes a new instance of the `ProcessNotFoundException` class for the specified process identifier.

    processId: ProcessId
    The unique process identifier that was not found.
  • constructorProcessNotFoundException
    public ProcessNotFoundException(string message)

    Initializes a new instance of the `ProcessNotFoundException` class with a specified error message.

    message: string
    The message that describes the error.
  • constructorProcessNotFoundException
    public ProcessNotFoundException(string message, Exception? innerException)

    Initializes a new instance of the `ProcessNotFoundException` class with a specified error message and inner exception.

    message: string
    The error message that explains the reason for the exception.
    innerException: Exception?
    The exception that is the cause of the current exception, or `null`.
  • constructorProcessNotFoundException
    public ProcessNotFoundException(string message, ProcessId processId, Exception? innerException = null)

    Initializes a new instance of the `ProcessNotFoundException` class with a specified error message and process identifier.

    message: string
    The message that describes the error.
    processId: ProcessId
    The unique process identifier that was not found.
    innerException: Exception?
    The exception that is the cause of the current exception, or `null`.
enum

ProcessSaveResult

Assembly: EricksonLopez.Processes.Abstractions
public enum ProcessSaveResult

Specifies the outcome of saving a process instance to durable storage.

Members (4)

  • fieldConcurrencyConflict
    ConcurrencyConflict = 1

    Specifies that an optimistic concurrency conflict occurred because the stored revision did not match the expected revision.

  • fieldNotFound
    NotFound = 2

    Specifies that the target process instance was not found in storage.

  • fieldPersistenceError
    PersistenceError = 3

    Specifies that a storage or network infrastructure error occurred during persistence.

  • fieldSuccess
    Success = 0

    Specifies that the process instance was successfully created or updated with a matching revision token.

record

ProcessStateRecord

Assembly: EricksonLopez.Processes.Abstractions
public sealed record ProcessStateRecord

Represents a flat, schema-agnostic storage record of a process instance for database engines.

Members (11)

  • propertyCompletedAt
    public DateTimeOffset? CompletedAt { get; init; }

    Gets the UTC timestamp when the process reached a terminal status, if any.

  • propertyCorrelationId
    public required string CorrelationId { get; init; }

    Gets the business correlation identifier.

  • propertyCreatedAt
    public required DateTimeOffset CreatedAt { get; init; }

    Gets the UTC timestamp when the process instance was created.

  • propertyProcessId
    public required string ProcessId { get; init; }

    Gets the unique process instance identifier as a string.

  • propertyProcessType
    public required string ProcessType { get; init; }

    Gets the logical process type name or identifier.

  • propertyRecordedCompensationsPayload
    public string RecordedCompensationsPayload { get; init; }

    Gets the serialized JSON array of recorded compensation steps.

  • propertyRevision
    public required long Revision { get; init; }

    Gets the optimistic concurrency revision integer token.

  • propertyStatePayload
    public required string StatePayload { get; init; }

    Gets the serialized state payload string.

  • propertyStatus
    public required int Status { get; init; }

    Gets the integer representation of the lifecycle execution status.

  • propertyUpdatedAt
    public required DateTimeOffset UpdatedAt { get; init; }

    Gets the UTC timestamp when the process instance was last updated.

  • propertyVersion
    public required string Version { get; init; }

    Gets the schema or definition version string.

enum

ProcessStatus

Assembly: EricksonLopez.Processes.Abstractions
public enum ProcessStatus

Specifies the lifecycle execution status of a process or saga instance.

Members (7)

  • fieldCompensated
    Compensated = 5

    Specifies that all compensating actions completed successfully in a terminal state.

  • fieldCompensating
    Compensating = 4

    Specifies that an error occurred and compensating actions are actively executing.

  • fieldCompleted
    Completed = 3

    Specifies that the process has successfully finished all steps and reached a terminal state.

  • fieldFailed
    Failed = 6

    Specifies that the process encountered an unrecoverable failure requiring intervention.

  • fieldInitialized
    Initialized = 0

    Specifies that the process instance is created and initialized, but has not yet processed triggers.

  • fieldRunning
    Running = 1

    Specifies that the process is actively executing forward workflow steps.

  • fieldSuspended
    Suspended = 2

    Specifies that the process is suspended, awaiting external input, manual approval, or a timer.

record

ProcessTransitionResult<TState>

Assembly: EricksonLopez.Processes.Abstractions
public sealed record ProcessTransitionResult<TState> where TState : notnull

Represents the outcome of handling an event within a process manager or saga.

Remarks:

Type parameters: TState: The domain state type.

Members (13)

  • constructorProcessTransitionResult
    public ProcessTransitionResult(TState state, ProcessStatus status, IReadOnlyList<ProcessEffect>? effects = null, IReadOnlyList<CompensationStep>? recordedCompensations = null, string? failureReason = null)

    Initializes a new instance of the `ProcessTransitionResult<TState>` record with state, status, and side effects.

    state: TState
    The updated domain state.
    status: ProcessStatus
    The target lifecycle status.
    effects: IReadOnlyList<ProcessEffect>?
    The optional list of emitted side-effect intents.
    recordedCompensations: IReadOnlyList<CompensationStep>?
    The optional list of recorded compensation steps.
    failureReason: string?
    The optional failure reason explanation.

    Exceptions: ArgumentNullException: `state` is `null`

  • methodAdvance
    public static ProcessTransitionResult<TState> Advance(TState state, ProcessStatus status = ProcessStatus.Running, IEnumerable<ProcessEffect>? effects = null, IEnumerable<CompensationStep>? recordedCompensations = null)

    Advances the process to a new state and status.

    state: TState
    The updated domain state.
    status: ProcessStatus
    The target lifecycle status (defaults to `ProcessStatus.Running`).
    effects: IEnumerable<ProcessEffect>?
    The optional side-effect intents to emit.
    recordedCompensations: IEnumerable<CompensationStep>?
    The optional compensation steps to record.

    Returns: A new `ProcessTransitionResult<TState>` instance.

  • methodCompensate
    public static ProcessTransitionResult<TState> Compensate(TState state, IEnumerable<CompensationAction>? compensationActions = null)

    Transitions the saga to the `ProcessStatus.Compensating` state and emits compensating intents.

    state: TState
    The current domain state.
    compensationActions: IEnumerable<CompensationAction>?
    The optional compensation actions to trigger.

    Returns: A new `ProcessTransitionResult<TState>` instance.

  • methodCompensated
    public static ProcessTransitionResult<TState> Compensated(TState state, IEnumerable<ProcessEffect>? effects = null)

    Transitions the saga to the `ProcessStatus.Compensated` terminal state after all compensations execute.

    state: TState
    The compensated domain state.
    effects: IEnumerable<ProcessEffect>?
    The optional side-effect intents to emit.

    Returns: A new `ProcessTransitionResult<TState>` instance.

  • methodComplete
    public static ProcessTransitionResult<TState> Complete(TState state, IEnumerable<ProcessEffect>? effects = null, IEnumerable<CompensationStep>? recordedCompensations = null)

    Transitions the process to the `ProcessStatus.Completed` terminal state.

    state: TState
    The final domain state.
    effects: IEnumerable<ProcessEffect>?
    The optional side-effect intents to emit.
    recordedCompensations: IEnumerable<CompensationStep>?
    The optional compensation steps to record.

    Returns: A new `ProcessTransitionResult<TState>` instance.

  • methodFail
    public static ProcessTransitionResult<TState> Fail(TState state, string reason, IEnumerable<ProcessEffect>? effects = null)

    Transitions the process to the `ProcessStatus.Failed` terminal or escalated state.

    state: TState
    The failed domain state.
    reason: string
    The reason describing why the transition failed.
    effects: IEnumerable<ProcessEffect>?
    The optional side-effect intents to emit.

    Returns: A new `ProcessTransitionResult<TState>` instance.

    Exceptions: ArgumentException: `reason` is `null` or white-space

  • methodSuspend
    public static ProcessTransitionResult<TState> Suspend(TState state, IEnumerable<ProcessEffect>? effects = null)

    Transitions the process to the `ProcessStatus.Suspended` state awaiting external confirmation or a timer.

    state: TState
    The suspended domain state.
    effects: IEnumerable<ProcessEffect>?
    The optional side-effect intents to emit.

    Returns: A new `ProcessTransitionResult<TState>` instance.

  • methodUnchanged
    public static ProcessTransitionResult<TState> Unchanged(TState state, ProcessStatus currentStatus = ProcessStatus.Running)

    Returns a transition result that preserves the existing state and status without changes.

    state: TState
    The current domain state.
    currentStatus: ProcessStatus
    The current lifecycle status.

    Returns: A new `ProcessTransitionResult<TState>` instance.

  • propertyEffects
    public IReadOnlyList<ProcessEffect> Effects { get; init; }

    Gets the list of side-effect intents emitted by this transition.

  • propertyFailureReason
    public string? FailureReason { get; init; }

    Gets the reason for failure if the process transitioned to `ProcessStatus.Failed`.

  • propertyRecordedCompensations
    public IReadOnlyList<CompensationStep> RecordedCompensations { get; init; }

    Gets the list of newly recorded compensation steps produced by forward step execution.

  • propertyState
    public TState State { get; init; }

    Gets the updated domain state.

  • propertyStatus
    public ProcessStatus Status { get; init; }

    Gets the new lifecycle status of the process instance.

record

ProcessType

Assembly: EricksonLopez.Processes.Abstractions
public readonly record struct ProcessType : IComparable<ProcessType>, IComparable, ISpanFormattable, ISpanParsable<ProcessType>
Implements: IComparable, IComparable<ProcessType>, ISpanFormattable, ISpanParsable<ProcessType>

Represents the logical, immutable name and category of a process definition.

Members (21)

  • constructorProcessType
    public ProcessType(string value)

    Initializes a new instance of the `ProcessType` struct with the specified logical process type name.

    value: string
    The logical process type name.

    Exceptions: ArgumentException: `value` is `null` or white-space

  • methodCompareTo
    public int CompareTo(ProcessType other)

    Inherits documentation from base type or interface.

    other: ProcessType
  • methodCompareTo
    public int CompareTo(object? obj)

    Inherits documentation from base type or interface.

    obj: object?
  • methodFrom
    public static ProcessType From(string value)

    Creates a `ProcessType` from the specified string value.

    value: string
    The logical process type name.

    Returns: A new `ProcessType` instance.

    Exceptions: ArgumentException: `value` is `null` or white-space

  • methodFromString
    public static ProcessType FromString(string value)

    Creates a `ProcessType` from the specified string value.

    value: string
    The logical process type name.

    Returns: A new `ProcessType` instance.

    Exceptions: ArgumentException: `value` is `null` or white-space

  • methodParse
    public static ProcessType Parse(ReadOnlySpan<char> s)

    Parses a span of characters into a `ProcessType`.

    s: ReadOnlySpan<char>
    The span of characters to parse.

    Returns: The parsed `ProcessType`.

  • methodParse
    public static ProcessType Parse(ReadOnlySpan<char> s, IFormatProvider? provider)

    Inherits documentation from base type or interface.

    s: ReadOnlySpan<char>
    provider: IFormatProvider?
  • methodParse
    public static ProcessType Parse(string s)

    Parses a string into a `ProcessType`.

    s: string
    The string to parse.

    Returns: The parsed `ProcessType`.

  • methodParse
    public static ProcessType Parse(string s, IFormatProvider? provider)

    Inherits documentation from base type or interface.

    s: string
    provider: IFormatProvider?
  • methodToString
    public override string ToString()

    Inherits documentation from base type or interface.

  • methodToString
    public string ToString(string? format, IFormatProvider? formatProvider)

    Inherits documentation from base type or interface.

    format: string?
    formatProvider: IFormatProvider?
  • methodTryFormat
    public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider)

    Inherits documentation from base type or interface.

    destination: Span<char>
    charsWritten: out int
    format: ReadOnlySpan<char>
    provider: IFormatProvider?
  • methodTryParse
    public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out ProcessType result)

    Inherits documentation from base type or interface.

    s: ReadOnlySpan<char>
    provider: IFormatProvider?
    result: out ProcessType
  • methodTryParse
    public static bool TryParse(string? s, IFormatProvider? provider, out ProcessType result)

    Inherits documentation from base type or interface.

    s: string?
    provider: IFormatProvider?
    result: out ProcessType
  • methodexplicit operator ProcessType
    public static explicit operator ProcessType(string value)

    Converts a string to a `ProcessType` instance.

    value: string
    The logical process type name.

    Exceptions: ArgumentException: `value` is `null` or white-space

  • methodimplicit operator string
    public static implicit operator string(ProcessType type)

    Converts a `ProcessType` to its underlying string representation.

    type: ProcessType
    The process type to convert.
  • methodoperator <
    public static bool operator <(ProcessType left, ProcessType right)

    Determines whether one `ProcessType` instance is less than another.

    left: ProcessType
    The first process type to compare.
    right: ProcessType
    The second process type to compare.

    Returns: `true` if `left` is less than `right`; otherwise, `false`.

  • methodoperator <=
    public static bool operator <=(ProcessType left, ProcessType right)

    Determines whether one `ProcessType` instance is less than or equal to another.

    left: ProcessType
    The first process type to compare.
    right: ProcessType
    The second process type to compare.

    Returns: `true` if `left` is less than or equal to `right`; otherwise, `false`.

  • methodoperator >
    public static bool operator >(ProcessType left, ProcessType right)

    Determines whether one `ProcessType` instance is greater than another.

    left: ProcessType
    The first process type to compare.
    right: ProcessType
    The second process type to compare.

    Returns: `true` if `left` is greater than `right`; otherwise, `false`.

  • methodoperator >=
    public static bool operator >=(ProcessType left, ProcessType right)

    Determines whether one `ProcessType` instance is greater than or equal to another.

    left: ProcessType
    The first process type to compare.
    right: ProcessType
    The second process type to compare.

    Returns: `true` if `left` is greater than or equal to `right`; otherwise, `false`.

  • propertyValue
    public string Value { get; }

    Gets the string token representing the process type.

class

ProcessTypeAttribute

Assembly: EricksonLopez.Processes.Abstractions
public sealed class ProcessTypeAttribute : Attribute
Inherits: Attribute

Specifies the logical process type identifier for a process state or definition class.

Members (2)

  • constructorProcessTypeAttribute
    public ProcessTypeAttribute(string processType)

    Initializes a new instance of the `ProcessTypeAttribute` class with the specified process type.

    processType: string
    The logical process type identifier.

    Exceptions: ArgumentException: `processType` is `null` or white-space

  • propertyProcessType
    public string ProcessType { get; }

    Gets the unique logical process type identifier.

record

ProcessVersion

Assembly: EricksonLopez.Processes.Abstractions
public readonly record struct ProcessVersion : IComparable<ProcessVersion>, IComparable, ISpanFormattable, ISpanParsable<ProcessVersion>, IUtf8SpanParsable<ProcessVersion>
Implements: IComparable, IComparable<ProcessVersion>, ISpanFormattable, ISpanParsable<ProcessVersion>, IUtf8SpanParsable<ProcessVersion>

Represents the schema and definition version of a process.

Members (27)

  • constructorProcessVersion
    public ProcessVersion(int value)

    Initializes a new instance of the `ProcessVersion` struct with the specified version number.

    value: int
    The version number (must be greater than or equal to 1).

    Exceptions: ArgumentOutOfRangeException: `value` is less than 1

  • methodCompareTo
    public int CompareTo(ProcessVersion other)

    Inherits documentation from base type or interface.

    other: ProcessVersion
  • methodCompareTo
    public int CompareTo(object? obj)

    Inherits documentation from base type or interface.

    obj: object?
  • methodFrom
    public static ProcessVersion From(int value)

    Creates a `ProcessVersion` from an integer value.

    value: int
    The version number (must be greater than or equal to 1).

    Returns: A new `ProcessVersion` instance.

    Exceptions: ArgumentOutOfRangeException: `value` is less than 1

  • methodFromInt32
    public static ProcessVersion FromInt32(int value)

    Creates a `ProcessVersion` from an integer value.

    value: int
    The version number (must be greater than or equal to 1).

    Returns: A new `ProcessVersion` instance.

    Exceptions: ArgumentOutOfRangeException: `value` is less than 1

  • methodNext
    public ProcessVersion Next()

    Returns the next incremented version.

    Returns: A new `ProcessVersion` incremented by one.

  • methodParse
    public static ProcessVersion Parse(ReadOnlySpan<byte> utf8Text)

    Parses a span of UTF-8 bytes into a `ProcessVersion`.

    utf8Text: ReadOnlySpan<byte>
    The span of UTF-8 bytes to parse.

    Returns: The parsed `ProcessVersion`.

  • methodParse
    public static ProcessVersion Parse(ReadOnlySpan<byte> utf8Text, IFormatProvider? provider)

    Inherits documentation from base type or interface.

    utf8Text: ReadOnlySpan<byte>
    provider: IFormatProvider?
  • methodParse
    public static ProcessVersion Parse(ReadOnlySpan<char> s)

    Parses a span of characters into a `ProcessVersion`.

    s: ReadOnlySpan<char>
    The span of characters to parse.

    Returns: The parsed `ProcessVersion`.

  • methodParse
    public static ProcessVersion Parse(ReadOnlySpan<char> s, IFormatProvider? provider)

    Inherits documentation from base type or interface.

    s: ReadOnlySpan<char>
    provider: IFormatProvider?
  • methodParse
    public static ProcessVersion Parse(string s)

    Parses a string into a `ProcessVersion`.

    s: string
    The string to parse.

    Returns: The parsed `ProcessVersion`.

  • methodParse
    public static ProcessVersion Parse(string s, IFormatProvider? provider)

    Inherits documentation from base type or interface.

    s: string
    provider: IFormatProvider?
  • methodToInt32
    public int ToInt32()

    Converts this instance to its integer value.

    Returns: The version integer value.

  • methodToString
    public override string ToString()

    Inherits documentation from base type or interface.

  • methodToString
    public string ToString(string? format, IFormatProvider? formatProvider)

    Inherits documentation from base type or interface.

    format: string?
    formatProvider: IFormatProvider?
  • methodTryFormat
    public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider)

    Inherits documentation from base type or interface.

    destination: Span<char>
    charsWritten: out int
    format: ReadOnlySpan<char>
    provider: IFormatProvider?
  • methodTryParse
    public static bool TryParse(ReadOnlySpan<byte> utf8Text, IFormatProvider? provider, out ProcessVersion result)

    Inherits documentation from base type or interface.

    utf8Text: ReadOnlySpan<byte>
    provider: IFormatProvider?
    result: out ProcessVersion
  • methodTryParse
    public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out ProcessVersion result)

    Inherits documentation from base type or interface.

    s: ReadOnlySpan<char>
    provider: IFormatProvider?
    result: out ProcessVersion
  • methodTryParse
    public static bool TryParse(string? s, IFormatProvider? provider, out ProcessVersion result)

    Inherits documentation from base type or interface.

    s: string?
    provider: IFormatProvider?
    result: out ProcessVersion
  • methodexplicit operator ProcessVersion
    public static explicit operator ProcessVersion(int value)

    Converts an integer to a `ProcessVersion` instance.

    value: int
    The version number.

    Exceptions: ArgumentOutOfRangeException: `value` is less than 1

  • methodimplicit operator int
    public static implicit operator int(ProcessVersion version)

    Converts a `ProcessVersion` to its integer value.

    version: ProcessVersion
    The process version to convert.
  • methodoperator <
    public static bool operator <(ProcessVersion left, ProcessVersion right)

    Determines whether one `ProcessVersion` instance is less than another.

    left: ProcessVersion
    The first process version to compare.
    right: ProcessVersion
    The second process version to compare.

    Returns: `true` if `left` is less than `right`; otherwise, `false`.

  • methodoperator <=
    public static bool operator <=(ProcessVersion left, ProcessVersion right)

    Determines whether one `ProcessVersion` instance is less than or equal to another.

    left: ProcessVersion
    The first process version to compare.
    right: ProcessVersion
    The second process version to compare.

    Returns: `true` if `left` is less than or equal to `right`; otherwise, `false`.

  • methodoperator >
    public static bool operator >(ProcessVersion left, ProcessVersion right)

    Determines whether one `ProcessVersion` instance is greater than another.

    left: ProcessVersion
    The first process version to compare.
    right: ProcessVersion
    The second process version to compare.

    Returns: `true` if `left` is greater than `right`; otherwise, `false`.

  • methodoperator >=
    public static bool operator >=(ProcessVersion left, ProcessVersion right)

    Determines whether one `ProcessVersion` instance is greater than or equal to another.

    left: ProcessVersion
    The first process version to compare.
    right: ProcessVersion
    The second process version to compare.

    Returns: `true` if `left` is greater than or equal to `right`; otherwise, `false`.

  • propertyInitial
    public static ProcessVersion Initial { get; }

    Gets the initial version (`1`).

  • propertyValue
    public int Value { get; }

    Gets the integer version value.

record

Revision

Assembly: EricksonLopez.Processes.Abstractions
public readonly record struct Revision : IComparable<Revision>, IComparable, ISpanFormattable, ISpanParsable<Revision>, IUtf8SpanParsable<Revision>
Implements: IComparable, IComparable<Revision>, ISpanFormattable, ISpanParsable<Revision>, IUtf8SpanParsable<Revision>

Represents a monotonically increasing revision token for optimistic concurrency control in state persistence.

Members (28)

  • constructorRevision
    public Revision(long value)

    Initializes a new instance of the `Revision` struct with the specified revision value.

    value: long
    The revision value (must be greater than or equal to 0).

    Exceptions: ArgumentOutOfRangeException: `value` is less than 0

  • methodCompareTo
    public int CompareTo(Revision other)

    Inherits documentation from base type or interface.

    other: Revision
  • methodCompareTo
    public int CompareTo(object? obj)

    Inherits documentation from base type or interface.

    obj: object?
  • methodFrom
    public static Revision From(long value)

    Creates a `Revision` from a long integer value.

    value: long
    The revision value (must be greater than or equal to 0).

    Returns: A new `Revision` instance.

    Exceptions: ArgumentOutOfRangeException: `value` is less than 0

  • methodFromInt64
    public static Revision FromInt64(long value)

    Creates a `Revision` from a long integer value.

    value: long
    The revision value (must be greater than or equal to 0).

    Returns: A new `Revision` instance.

    Exceptions: ArgumentOutOfRangeException: `value` is less than 0

  • methodNext
    public Revision Next()

    Returns the next incremented revision.

    Returns: A new `Revision` incremented by one.

  • methodParse
    public static Revision Parse(ReadOnlySpan<byte> utf8Text)

    Parses a span of UTF-8 bytes into a `Revision`.

    utf8Text: ReadOnlySpan<byte>
    The span of UTF-8 bytes to parse.

    Returns: The parsed `Revision`.

  • methodParse
    public static Revision Parse(ReadOnlySpan<byte> utf8Text, IFormatProvider? provider)

    Inherits documentation from base type or interface.

    utf8Text: ReadOnlySpan<byte>
    provider: IFormatProvider?
  • methodParse
    public static Revision Parse(ReadOnlySpan<char> s)

    Parses a span of characters into a `Revision`.

    s: ReadOnlySpan<char>
    The span of characters to parse.

    Returns: The parsed `Revision`.

  • methodParse
    public static Revision Parse(ReadOnlySpan<char> s, IFormatProvider? provider)

    Inherits documentation from base type or interface.

    s: ReadOnlySpan<char>
    provider: IFormatProvider?
  • methodParse
    public static Revision Parse(string s)

    Parses a string into a `Revision`.

    s: string
    The string to parse.

    Returns: The parsed `Revision`.

  • methodParse
    public static Revision Parse(string s, IFormatProvider? provider)

    Inherits documentation from base type or interface.

    s: string
    provider: IFormatProvider?
  • methodToInt64
    public long ToInt64()

    Converts this instance to its long integer value.

    Returns: The revision long integer value.

  • methodToString
    public override string ToString()

    Inherits documentation from base type or interface.

  • methodToString
    public string ToString(string? format, IFormatProvider? formatProvider)

    Inherits documentation from base type or interface.

    format: string?
    formatProvider: IFormatProvider?
  • methodTryFormat
    public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider)

    Inherits documentation from base type or interface.

    destination: Span<char>
    charsWritten: out int
    format: ReadOnlySpan<char>
    provider: IFormatProvider?
  • methodTryParse
    public static bool TryParse(ReadOnlySpan<byte> utf8Text, IFormatProvider? provider, out Revision result)

    Inherits documentation from base type or interface.

    utf8Text: ReadOnlySpan<byte>
    provider: IFormatProvider?
    result: out Revision
  • methodTryParse
    public static bool TryParse(ReadOnlySpan<char> s, IFormatProvider? provider, out Revision result)

    Inherits documentation from base type or interface.

    s: ReadOnlySpan<char>
    provider: IFormatProvider?
    result: out Revision
  • methodTryParse
    public static bool TryParse(string? s, IFormatProvider? provider, out Revision result)

    Inherits documentation from base type or interface.

    s: string?
    provider: IFormatProvider?
    result: out Revision
  • methodexplicit operator Revision
    public static explicit operator Revision(long value)

    Converts a long integer to a `Revision` instance.

    value: long
    The revision value.

    Exceptions: ArgumentOutOfRangeException: `value` is less than 0

  • methodimplicit operator long
    public static implicit operator long(Revision revision)

    Converts a `Revision` to its long integer value.

    revision: Revision
    The revision to convert.
  • methodoperator <
    public static bool operator <(Revision left, Revision right)

    Determines whether one `Revision` instance is less than another.

    left: Revision
    The first revision to compare.
    right: Revision
    The second revision to compare.

    Returns: `true` if `left` is less than `right`; otherwise, `false`.

  • methodoperator <=
    public static bool operator <=(Revision left, Revision right)

    Determines whether one `Revision` instance is less than or equal to another.

    left: Revision
    The first revision to compare.
    right: Revision
    The second revision to compare.

    Returns: `true` if `left` is less than or equal to `right`; otherwise, `false`.

  • methodoperator >
    public static bool operator >(Revision left, Revision right)

    Determines whether one `Revision` instance is greater than another.

    left: Revision
    The first revision to compare.
    right: Revision
    The second revision to compare.

    Returns: `true` if `left` is greater than `right`; otherwise, `false`.

  • methodoperator >=
    public static bool operator >=(Revision left, Revision right)

    Determines whether one `Revision` instance is greater than or equal to another.

    left: Revision
    The first revision to compare.
    right: Revision
    The second revision to compare.

    Returns: `true` if `left` is greater than or equal to `right`; otherwise, `false`.

  • propertyInitial
    public static Revision Initial { get; }

    Gets the initial committed revision (`1`).

  • propertyNone
    public static Revision None { get; }

    Gets the zero uncommitted revision (`0`).

  • propertyValue
    public long Value { get; }

    Gets the long revision value.

class

SagaDefinitionAttribute

Assembly: EricksonLopez.Processes.Abstractions
public sealed class SagaDefinitionAttribute : Attribute
Inherits: Attribute

Specifies that a class is a saga definition with compensation capabilities discovered for compile-time registration.

Members (3)

  • constructorSagaDefinitionAttribute
    public SagaDefinitionAttribute(string processType, int version = 1)

    Initializes a new instance of the `SagaDefinitionAttribute` class with the specified process type and version.

    processType: string
    The logical saga process type identifier.
    version: int
    The schema or definition version number.

    Exceptions: ArgumentException: `processType` is `null` or white-space

  • propertyProcessType
    public string ProcessType { get; }

    Gets the unique logical saga process type identifier.

  • propertyVersion
    public int Version { get; }

    Gets the schema or definition version number.

EricksonLopez.Processes.Analyzers#

1
class

ProcessTransitionAnalyzer

Assembly: EricksonLopez.Processes.Analyzers
public sealed class ProcessTransitionAnalyzer : DiagnosticAnalyzer
Inherits: DiagnosticAnalyzer

Provides a Roslyn diagnostic analyzer that validates process manager definitions and state machine consistency.

Members (5)

  • methodInitialize
    public override void Initialize(AnalysisContext context)

    Inherits documentation from base type or interface.

    context: AnalysisContext
  • propertySupportedDiagnostics
    public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; }

    Inherits documentation from base type or interface.

  • fieldDiagnosticIdDeadEndState
    public const string DiagnosticIdDeadEndState

    Gets the diagnostic identifier for dead-end non-terminal states or unreachable terminal state transitions.

  • fieldDiagnosticIdMissingCompensation
    public const string DiagnosticIdMissingCompensation

    Gets the diagnostic identifier for unhandled process transition compensation.

  • fieldDiagnosticIdMissingInitialState
    public const string DiagnosticIdMissingInitialState

    Gets the diagnostic identifier for missing initial state configuration.

EricksonLopez.Processes.DependencyInjection#

1
class

ServiceCollectionExtensions

Assembly: EricksonLopez.Processes.DependencyInjection
public static class ServiceCollectionExtensions

Provides extension methods for registering process framework services into an `IServiceCollection`.

Members (2)

  • methodAddProcessCoordinator<TState>
    public static IServiceCollection AddProcessCoordinator<TState>(this IServiceCollection services, Action<ProcessCoordinatorOptions>? configureOptions = null) where TState : notnull

    Registers a `ProcessCoordinator<TState>` for the specified domain state schema.

    services: this IServiceCollection
    The target service collection.
    configureOptions: Action<ProcessCoordinatorOptions>?
    The optional action to configure coordinator options.

    Returns: The `services` instance for method chaining.

    Type parameters: TState: The strongly typed domain state type. Exceptions: ArgumentNullException: `services` is `null`

  • methodAddProcesses
    public static IServiceCollection AddProcesses(this IServiceCollection services)

    Registers core process framework services, including the `ProcessRegistry`, into the service collection.

    services: this IServiceCollection
    The target service collection.

    Returns: The `services` instance for method chaining.

    Exceptions: ArgumentNullException: `services` is `null`

EricksonLopez.Processes.Events#

4
class

EventProcessDispatcher

Assembly: EricksonLopez.Processes.Events
public sealed class EventProcessDispatcher : IEventProcessDispatcher
Implements: IEventProcessDispatcher

Dispatches process manager side-effect intents through an event publisher.

Members (3)

  • constructorEventProcessDispatcher
    public EventProcessDispatcher(IEventPublisher eventPublisher, TimeProvider? timeProvider = null)

    Initializes a new instance of the `EventProcessDispatcher` class with the specified event publisher.

    eventPublisher: IEventPublisher
    The event publisher instance.
    timeProvider: TimeProvider?
    An optional `TimeProvider` for controlling delay scheduling.

    Exceptions: ArgumentNullException: `eventPublisher` is `null`

  • methodDispatchEffectAsync
    public ValueTask DispatchEffectAsync(ProcessEffect effect, ProcessId processId, CancellationToken cancellationToken = default)

    Dispatches a single process effect through the event publisher.

    effect: ProcessEffect
    The process effect to dispatch.
    processId: ProcessId
    The unique process identifier.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation.

  • methodDispatchEffectsAsync
    public async ValueTask DispatchEffectsAsync(IEnumerable<ProcessEffect> effects, ProcessId processId, CancellationToken cancellationToken = default)

    Dispatches a batch of process effects through the event publisher.

    effects: IEnumerable<ProcessEffect>
    The collection of process effects to dispatch.
    processId: ProcessId
    The unique process identifier.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation.

interface

IEventProcessDispatcher

Assembly: EricksonLopez.Processes.Events
public interface IEventProcessDispatcher

Defines a contract for dispatching process effects as domain or integration events through an event publisher.

Members (2)

  • methodDispatchEffectAsync
    ValueTask DispatchEffectAsync(ProcessEffect effect, ProcessId processId, CancellationToken cancellationToken = default)

    Dispatches a single process effect through the event publisher.

    effect: ProcessEffect
    The process effect to dispatch.
    processId: ProcessId
    The unique process identifier.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation.

  • methodDispatchEffectsAsync
    ValueTask DispatchEffectsAsync(IEnumerable<ProcessEffect> effects, ProcessId processId, CancellationToken cancellationToken = default)

    Dispatches a batch of process effects through the event publisher.

    effects: IEnumerable<ProcessEffect>
    The collection of process effects to dispatch.
    processId: ProcessId
    The unique process identifier.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation.

class

ProcessEventsIdentifierExtensions

Assembly: EricksonLopez.Processes.Events
public static class ProcessEventsIdentifierExtensions

Provides extension and mapping methods between process identifiers and event identifiers.

Members (4)

  • methodToEventsCausationId
    public static EricksonLopez.Events.Identifiers.CausationId ToEventsCausationId(this CausationId id)

    Converts a process causation identifier to an events causation identifier.

    id: this CausationId
    The process causation identifier to convert.

    Returns: A new `Identifiers.CausationId` with the same value.

  • methodToEventsCorrelationId
    public static EricksonLopez.Events.Identifiers.CorrelationId ToEventsCorrelationId(this CorrelationId id)

    Converts a process correlation identifier to an events correlation identifier.

    id: this CorrelationId
    The process correlation identifier to convert.

    Returns: A new `Identifiers.CorrelationId` with the same value.

  • methodToProcessesCausationId
    public static CausationId ToProcessesCausationId(this EricksonLopez.Events.Identifiers.CausationId id)

    Converts an events causation identifier to a process causation identifier.

    id: this EricksonLopez.Events.Identifiers.CausationId
    The events causation identifier to convert.

    Returns: A new `Abstractions.CausationId` with the same value.

  • methodToProcessesCorrelationId
    public static CorrelationId ToProcessesCorrelationId(this EricksonLopez.Events.Identifiers.CorrelationId id)

    Converts an events correlation identifier to a process correlation identifier.

    id: this EricksonLopez.Events.Identifiers.CorrelationId
    The events correlation identifier to convert.

    Returns: A new `Abstractions.CorrelationId` with the same value.

class

ProcessEventsServiceCollectionExtensions

Assembly: EricksonLopez.Processes.Events
public static class ProcessEventsServiceCollectionExtensions

Provides extension methods for registering event process dispatcher services with dependency injection.

Members (1)

  • methodAddProcessEventsDispatcher
    public static IServiceCollection AddProcessEventsDispatcher(this IServiceCollection services)

    Registers the `EventProcessDispatcher` implementation of `IEventProcessDispatcher` into the service collection.

    services: this IServiceCollection
    The target service collection.

    Returns: The `services` instance for method chaining.

EricksonLopez.Processes.Generator#

1
class

ProcessSourceGenerator

Assembly: EricksonLopez.Processes.Generator
public sealed class ProcessSourceGenerator : IIncrementalGenerator
Implements: IIncrementalGenerator

Generates compile-time static registration and metadata tables for discovered Process and Saga definitions.

Members (1)

  • methodInitialize
    public void Initialize(IncrementalGeneratorInitializationContext context)

    Inherits documentation from base type or interface.

    context: IncrementalGeneratorInitializationContext

EricksonLopez.Processes.Mediator#

3
interface

IMediatorProcessDispatcher

Assembly: EricksonLopez.Processes.Mediator
public interface IMediatorProcessDispatcher

Defines a contract for dispatching process effects directly through an in-memory mediator.

Members (2)

  • methodDispatchEffectAsync
    ValueTask DispatchEffectAsync(ProcessEffect effect, ProcessId processId, CancellationToken cancellationToken = default)

    Dispatches a single process effect through the mediator.

    effect: ProcessEffect
    The process effect to dispatch.
    processId: ProcessId
    The unique process identifier.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation.

  • methodDispatchEffectsAsync
    ValueTask DispatchEffectsAsync(IEnumerable<ProcessEffect> effects, ProcessId processId, CancellationToken cancellationToken = default)

    Dispatches a batch of process effects through the mediator.

    effects: IEnumerable<ProcessEffect>
    The collection of process effects to dispatch.
    processId: ProcessId
    The unique process identifier.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation.

class

MediatorProcessDispatcher

Assembly: EricksonLopez.Processes.Mediator
public sealed class MediatorProcessDispatcher : IMediatorProcessDispatcher
Implements: IMediatorProcessDispatcher

Dispatches process manager side-effect intents directly through an in-memory mediator.

Members (5)

  • constructorMediatorProcessDispatcher
    public MediatorProcessDispatcher(IMediator mediator, TimeProvider? timeProvider = null, MediatorProcessDispatcherOptions? options = null)

    Initializes a new instance of the `MediatorProcessDispatcher` class with the specified mediator.

    mediator: IMediator
    The mediator instance.
    timeProvider: TimeProvider?
    An optional `TimeProvider` for controlling delay scheduling.
    options: MediatorProcessDispatcherOptions?
    Optional configuration for decoupled command and notification payload adaptation.

    Exceptions: ArgumentNullException: `mediator` is `null`

  • methodDispatchEffectAsync
    public async ValueTask DispatchEffectAsync(ProcessEffect effect, ProcessId processId, CancellationToken cancellationToken = default)

    Dispatches a single process effect through the mediator.

    effect: ProcessEffect
    The process effect to dispatch.
    processId: ProcessId
    The unique process identifier.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation.

  • methodDispatchEffectsAsync
    public async ValueTask DispatchEffectsAsync(IEnumerable<ProcessEffect> effects, ProcessId processId, CancellationToken cancellationToken = default)

    Dispatches a batch of process effects through the mediator.

    effects: IEnumerable<ProcessEffect>
    The collection of process effects to dispatch.
    processId: ProcessId
    The unique process identifier.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation.

  • propertyCommandWrapper
    public Func<object, object?>? CommandWrapper { get; set; }

    Gets or sets an optional adapter function that wraps decoupled domain command or event payloads into `ICommand<TResponse>` or `INotification` instances before dispatching.

  • propertyOnUnrecognizedPayload
    public Action<ProcessId, ProcessEffect, object?>? OnUnrecognizedPayload { get; set; }

    Gets or sets an optional callback invoked when a `ProcessEffect` payload cannot be dispatched.

    Use this callback to log, trace, or handle payloads that are not recognized by the dispatcher.

class

MediatorProcessDispatcherOptions

Assembly: EricksonLopez.Processes.Mediator
public sealed class MediatorProcessDispatcherOptions

Provides configuration options for `MediatorProcessDispatcher`, enabling decoupled domain command and event adaptation without requiring domain payloads to implement mediator marker interfaces directly.

Members (5)

  • methodMapCommand<TCommand, TResponse>
    public MediatorProcessDispatcherOptions MapCommand<TCommand, TResponse>(Func<TCommand, ICommand<TResponse>> mapper) where TCommand : notnull

    Registers a typed adapter that maps a domain command payload of type `TCommand` to an `ICommand<TResponse>` with an arbitrary response type.

    mapper: Func<TCommand, ICommand<TResponse>>
    The mapping function.

    Returns: The current `MediatorProcessDispatcherOptions` instance for chaining.

    Type parameters: TCommand: The domain command payload type.; TResponse: The mediator command response type.

  • methodMapCommand<TCommand>
    public MediatorProcessDispatcherOptions MapCommand<TCommand>(Func<TCommand, ICommand<bool>> mapper) where TCommand : notnull

    Registers a typed adapter that maps a domain command payload of type `TCommand` to an `ICommand<TResponse>` returning `bool`.

    mapper: Func<TCommand, ICommand<bool>>
    The mapping function.

    Returns: The current `MediatorProcessDispatcherOptions` instance for chaining.

    Type parameters: TCommand: The domain command payload type.

  • methodMapNotification<TEvent>
    public MediatorProcessDispatcherOptions MapNotification<TEvent>(Func<TEvent, INotification> mapper) where TEvent : notnull

    Registers a typed adapter that maps a domain event or timeout payload of type `TEvent` to an `INotification`.

    mapper: Func<TEvent, INotification>
    The mapping function.

    Returns: The current `MediatorProcessDispatcherOptions` instance for chaining.

    Type parameters: TEvent: The domain event payload type.

  • methodRegisterHandler<TPayload>
    public MediatorProcessDispatcherOptions RegisterHandler<TPayload>(Func<IMediator, TPayload, CancellationToken, ValueTask> handler) where TPayload : notnull

    Registers a custom asynchronous dispatch delegate for a domain payload of type `TPayload`.

    handler: Func<IMediator, TPayload, CancellationToken, ValueTask>
    The asynchronous dispatch delegate.

    Returns: The current `MediatorProcessDispatcherOptions` instance for chaining.

    Type parameters: TPayload: The domain payload type.

  • propertyCommandWrapper
    public Func<object, object?>? CommandWrapper { get; set; }

    Gets or sets an optional general adapter delegate that converts arbitrary domain command or event payloads into `ICommand<TResponse>` or `INotification` instances.

EricksonLopez.Processes.Outbox#

2
interface

IProcessOutboxDispatcher

Assembly: EricksonLopez.Processes.Outbox
public interface IProcessOutboxDispatcher

Defines a contract for dispatching process effects to a transactional outbox.

Members (3)

  • methodDispatchBatchAsync
    ValueTask DispatchBatchAsync(IEnumerable<ProcessEffect> effects, ProcessId processId, IOutboxTransactionContext transaction, CancellationToken cancellationToken = default)

    Dispatches a batch of process effects to the outbox within the specified transaction context using batch storage.

    effects: IEnumerable<ProcessEffect>
    The collection of process effects to dispatch as a batch.
    processId: ProcessId
    The unique process identifier.
    transaction: IOutboxTransactionContext
    The required outbox transaction context.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation.

  • methodDispatchEffectAsync
    ValueTask DispatchEffectAsync(ProcessEffect effect, ProcessId processId, IOutboxTransactionContext? transaction = null, CancellationToken cancellationToken = default)

    Dispatches a single process effect to the outbox within the specified transaction context.

    effect: ProcessEffect
    The process effect to dispatch.
    processId: ProcessId
    The unique process identifier.
    transaction: IOutboxTransactionContext?
    The optional outbox transaction context.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation.

  • methodDispatchEffectsAsync
    ValueTask DispatchEffectsAsync(IEnumerable<ProcessEffect> effects, ProcessId processId, IOutboxTransactionContext? transaction = null, CancellationToken cancellationToken = default)

    Dispatches a sequence of process effects to the outbox within the specified transaction context.

    effects: IEnumerable<ProcessEffect>
    The collection of process effects to dispatch.
    processId: ProcessId
    The unique process identifier.
    transaction: IOutboxTransactionContext?
    The optional outbox transaction context.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation.

class

OutboxProcessDispatcher

Assembly: EricksonLopez.Processes.Outbox
public sealed class OutboxProcessDispatcher : IProcessOutboxDispatcher
Implements: IProcessOutboxDispatcher

Dispatches process manager side-effect intents reliably via an outbox persistence mechanism.

Members (4)

  • constructorOutboxProcessDispatcher
    public OutboxProcessDispatcher(IOutbox outbox, TimeProvider? timeProvider = null)

    Initializes a new instance of the `OutboxProcessDispatcher` class with the specified outbox and time provider.

    outbox: IOutbox
    The outbox instance.
    timeProvider: TimeProvider?
    The optional time provider for deterministic timestamp generation, or `null` to use `TimeProvider.System`.

    Exceptions: ArgumentNullException: `outbox` is `null`

  • methodDispatchBatchAsync
    public async ValueTask DispatchBatchAsync(IEnumerable<ProcessEffect> effects, ProcessId processId, IOutboxTransactionContext transaction, CancellationToken cancellationToken = default)

    Dispatches a batch of process effects to the outbox within the specified transaction context using batch storage.

    effects: IEnumerable<ProcessEffect>
    The collection of process effects to dispatch as a batch.
    processId: ProcessId
    The unique process identifier.
    transaction: IOutboxTransactionContext
    The required outbox transaction context.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation.

  • methodDispatchEffectAsync
    public async ValueTask DispatchEffectAsync(ProcessEffect effect, ProcessId processId, IOutboxTransactionContext? transaction = null, CancellationToken cancellationToken = default)

    Dispatches a single process effect to the outbox within the specified transaction context.

    effect: ProcessEffect
    The process effect to dispatch.
    processId: ProcessId
    The unique process identifier.
    transaction: IOutboxTransactionContext?
    The optional outbox transaction context.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation.

  • methodDispatchEffectsAsync
    public async ValueTask DispatchEffectsAsync(IEnumerable<ProcessEffect> effects, ProcessId processId, IOutboxTransactionContext? transaction = null, CancellationToken cancellationToken = default)

    Dispatches a sequence of process effects to the outbox within the specified transaction context.

    effects: IEnumerable<ProcessEffect>
    The collection of process effects to dispatch.
    processId: ProcessId
    The unique process identifier.
    transaction: IOutboxTransactionContext?
    The optional outbox transaction context.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation.

EricksonLopez.Processes.Storage.MariaDb#

2
class

MariaDbProcessStore<TState>

Assembly: EricksonLopez.Processes.Storage.MariaDb
public sealed partial class MariaDbProcessStore<TState> : IProcessStore<TState> where TState : notnull
Implements: IProcessStore<TState>

Provides a MariaDB implementation of `IProcessStore<TState>` using raw parameterized MySqlConnector commands and JSON payloads.

Remarks:

Type parameters: TState: The process domain state type.

Members (8)

  • constructorMariaDbProcessStore
    public MariaDbProcessStore(string connectionString, IProcessStateSerializer<TState> serializer, string tableName = "", ILogger<MariaDbProcessStore<TState>>? logger = null)

    Initializes a new instance of the `MariaDbProcessStore<TState>` class with the specified connection string and serializer.

    connectionString: string
    The MariaDB connection string.
    serializer: IProcessStateSerializer<TState>
    The state serializer instance.
    tableName: string
    The table name for process instances (defaults to 'process_instances').
    logger: ILogger<MariaDbProcessStore<TState>>?
    The optional logger instance, or `null`.

    Exceptions: ArgumentException: `connectionString` or `tableName` is `null` or white-space; ArgumentNullException: `serializer` is `null`

  • methodBeginConnectionScopeAsync
    public ValueTask<IAsyncDisposable?> BeginConnectionScopeAsync(CancellationToken cancellationToken = default)

    Begins an optional connection-leasing scope across an execution or retry cycle to avoid connection pool churn.

    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains an `IAsyncDisposable` scope, or `null` if connection scoping is not used by the store.

  • methodExistsAsync
    public async ValueTask<bool> ExistsAsync(ProcessId id, CancellationToken cancellationToken = default)

    Determines whether a process instance with the specified identifier exists in storage.

    id: ProcessId
    The unique process identifier.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains `true` if the instance exists; otherwise, `false`.

  • methodGetByCorrelationIdAsync
    public async ValueTask<ProcessInstance<TState>?> GetByCorrelationIdAsync(CorrelationId correlationId, CancellationToken cancellationToken = default)

    Retrieves a process instance by its business correlation identifier.

    correlationId: CorrelationId
    The business correlation identifier.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains the matching `ProcessInstance<TState>`, or `null` if not found.

  • methodGetByIdAsync
    public async ValueTask<ProcessInstance<TState>?> GetByIdAsync(ProcessId id, CancellationToken cancellationToken = default)

    Retrieves a process instance by its unique identifier.

    id: ProcessId
    The unique process identifier.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains the persisted `ProcessInstance<TState>`, or `null` if not found.

  • methodSaveAsync
    public async ValueTask<ProcessSaveResult> SaveAsync(ProcessInstance<TState> instance, CancellationToken cancellationToken = default)

    Persists a new or updated process instance using optimistic concurrency control.

    instance: ProcessInstance<TState>
    The process instance to save.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains a `ProcessSaveResult` indicating the outcome.

  • propertyConnectionOpenCount
    public int ConnectionOpenCount { get; }

    Gets the total number of physical database connections opened by this store instance.

  • propertyQuotedTableName
    public string QuotedTableName { get; }

    Gets the properly backtick-quoted MariaDB table identifier (supporting schema.table qualification).

class

ProcessMariaDbServiceCollectionExtensions

Assembly: EricksonLopez.Processes.Storage.MariaDb
public static class ProcessMariaDbServiceCollectionExtensions

Provides extension methods for registering MariaDB process store persistence with an `IServiceCollection`.

Members (1)

  • methodAddMariaDbProcessStore<TState>
    public static IServiceCollection AddMariaDbProcessStore<TState>(this IServiceCollection services, string connectionString, string tableName = "") where TState : notnull

    Registers `MariaDbProcessStore<TState>` as the implementation of `IProcessStore<TState>` in the service collection.

    services: this IServiceCollection
    The target service collection.
    connectionString: string
    The MariaDB database connection string.
    tableName: string
    The table name for process records (defaults to 'process_instances').

    Returns: The `services` instance for method chaining.

    Type parameters: TState: The strongly typed domain state type. Exceptions: ArgumentNullException: `services` is `null`; ArgumentException: `connectionString` is `null` or white-space

EricksonLopez.Processes.Storage.MySql#

2
class

MySqlProcessStore<TState>

Assembly: EricksonLopez.Processes.Storage.MySql
public sealed partial class MySqlProcessStore<TState> : IProcessStore<TState> where TState : notnull
Implements: IProcessStore<TState>

Provides a MySQL implementation of `IProcessStore<TState>` using raw parameterized MySqlConnector commands and JSON payloads.

Remarks:

Type parameters: TState: The process domain state type.

Members (8)

  • constructorMySqlProcessStore
    public MySqlProcessStore(string connectionString, IProcessStateSerializer<TState> serializer, string tableName = "", ILogger<MySqlProcessStore<TState>>? logger = null)

    Initializes a new instance of the `MySqlProcessStore<TState>` class with the specified connection string and serializer.

    connectionString: string
    The MySQL connection string.
    serializer: IProcessStateSerializer<TState>
    The state serializer instance.
    tableName: string
    The table name for process instances (defaults to 'process_instances').
    logger: ILogger<MySqlProcessStore<TState>>?
    The optional logger instance, or `null`.

    Exceptions: ArgumentException: `connectionString` or `tableName` is `null` or white-space; ArgumentNullException: `serializer` is `null`

  • methodBeginConnectionScopeAsync
    public ValueTask<IAsyncDisposable?> BeginConnectionScopeAsync(CancellationToken cancellationToken = default)

    Begins an optional connection-leasing scope across an execution or retry cycle to avoid connection pool churn.

    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains an `IAsyncDisposable` scope, or `null` if connection scoping is not used by the store.

  • methodExistsAsync
    public async ValueTask<bool> ExistsAsync(ProcessId id, CancellationToken cancellationToken = default)

    Determines whether a process instance with the specified identifier exists in storage.

    id: ProcessId
    The unique process identifier.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains `true` if the instance exists; otherwise, `false`.

  • methodGetByCorrelationIdAsync
    public async ValueTask<ProcessInstance<TState>?> GetByCorrelationIdAsync(CorrelationId correlationId, CancellationToken cancellationToken = default)

    Retrieves a process instance by its business correlation identifier.

    correlationId: CorrelationId
    The business correlation identifier.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains the matching `ProcessInstance<TState>`, or `null` if not found.

  • methodGetByIdAsync
    public async ValueTask<ProcessInstance<TState>?> GetByIdAsync(ProcessId id, CancellationToken cancellationToken = default)

    Retrieves a process instance by its unique identifier.

    id: ProcessId
    The unique process identifier.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains the persisted `ProcessInstance<TState>`, or `null` if not found.

  • methodSaveAsync
    public async ValueTask<ProcessSaveResult> SaveAsync(ProcessInstance<TState> instance, CancellationToken cancellationToken = default)

    Persists a new or updated process instance using optimistic concurrency control.

    instance: ProcessInstance<TState>
    The process instance to save.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains a `ProcessSaveResult` indicating the outcome.

  • propertyConnectionOpenCount
    public int ConnectionOpenCount { get; }

    Gets the total number of physical database connections opened by this store instance.

  • propertyQuotedTableName
    public string QuotedTableName { get; }

    Gets the properly backtick-quoted MySQL table identifier (supporting schema.table qualification).

class

ProcessMySqlServiceCollectionExtensions

Assembly: EricksonLopez.Processes.Storage.MySql
public static class ProcessMySqlServiceCollectionExtensions

Provides extension methods for registering MySQL process store persistence with an `IServiceCollection`.

Members (1)

  • methodAddMySqlProcessStore<TState>
    public static IServiceCollection AddMySqlProcessStore<TState>(this IServiceCollection services, string connectionString, string tableName = "") where TState : notnull

    Registers `MySqlProcessStore<TState>` as the implementation of `IProcessStore<TState>` in the service collection.

    services: this IServiceCollection
    The target service collection.
    connectionString: string
    The MySQL database connection string.
    tableName: string
    The table name for process records (defaults to 'process_instances').

    Returns: The `services` instance for method chaining.

    Type parameters: TState: The strongly typed domain state type. Exceptions: ArgumentNullException: `services` is `null`; ArgumentException: `connectionString` is `null` or white-space

EricksonLopez.Processes.Storage.Oracle#

2
class

OracleProcessStore<TState>

Assembly: EricksonLopez.Processes.Storage.Oracle
public sealed partial class OracleProcessStore<TState> : IProcessStore<TState> where TState : notnull
Implements: IProcessStore<TState>

Provides an Oracle implementation of `IProcessStore<TState>` using raw parameterized OracleCommand and JSON payloads.

Remarks:

Type parameters: TState: The process domain state type.

Members (8)

  • constructorOracleProcessStore
    public OracleProcessStore(string connectionString, IProcessStateSerializer<TState> serializer, string tableName = "", ILogger<OracleProcessStore<TState>>? logger = null)

    Initializes a new instance of the `OracleProcessStore<TState>` class with the specified connection string and serializer.

    connectionString: string
    The Oracle connection string.
    serializer: IProcessStateSerializer<TState>
    The state serializer instance.
    tableName: string
    The table name for process instances (defaults to 'PROCESS_INSTANCES').
    logger: ILogger<OracleProcessStore<TState>>?
    The optional logger instance, or `null`.

    Exceptions: ArgumentException: `connectionString` or `tableName` is `null` or white-space; ArgumentNullException: `serializer` is `null`

  • methodBeginConnectionScopeAsync
    public ValueTask<IAsyncDisposable?> BeginConnectionScopeAsync(CancellationToken cancellationToken = default)

    Begins an optional connection-leasing scope across an execution or retry cycle to avoid connection pool churn.

    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains an `IAsyncDisposable` scope, or `null` if connection scoping is not used by the store.

  • methodExistsAsync
    public async ValueTask<bool> ExistsAsync(ProcessId id, CancellationToken cancellationToken = default)

    Determines whether a process instance with the specified identifier exists in storage.

    id: ProcessId
    The unique process identifier.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains `true` if the instance exists; otherwise, `false`.

  • methodGetByCorrelationIdAsync
    public async ValueTask<ProcessInstance<TState>?> GetByCorrelationIdAsync(CorrelationId correlationId, CancellationToken cancellationToken = default)

    Retrieves a process instance by its business correlation identifier.

    correlationId: CorrelationId
    The business correlation identifier.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains the matching `ProcessInstance<TState>`, or `null` if not found.

  • methodGetByIdAsync
    public async ValueTask<ProcessInstance<TState>?> GetByIdAsync(ProcessId id, CancellationToken cancellationToken = default)

    Retrieves a process instance by its unique identifier.

    id: ProcessId
    The unique process identifier.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains the persisted `ProcessInstance<TState>`, or `null` if not found.

  • methodSaveAsync
    public async ValueTask<ProcessSaveResult> SaveAsync(ProcessInstance<TState> instance, CancellationToken cancellationToken = default)

    Persists a new or updated process instance using optimistic concurrency control.

    instance: ProcessInstance<TState>
    The process instance to save.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains a `ProcessSaveResult` indicating the outcome.

  • propertyConnectionOpenCount
    public int ConnectionOpenCount { get; }

    Gets the total number of physical database connections opened by this store instance.

  • propertyQuotedTableName
    public string QuotedTableName { get; }

    Gets the properly double-quoted Oracle table identifier (supporting schema.table qualification).

class

ProcessOracleServiceCollectionExtensions

Assembly: EricksonLopez.Processes.Storage.Oracle
public static class ProcessOracleServiceCollectionExtensions

Provides extension methods for registering Oracle process store persistence with an `IServiceCollection`.

Members (1)

  • methodAddOracleProcessStore<TState>
    public static IServiceCollection AddOracleProcessStore<TState>(this IServiceCollection services, string connectionString, string tableName = "") where TState : notnull

    Registers `OracleProcessStore<TState>` as the implementation of `IProcessStore<TState>` in the service collection.

    services: this IServiceCollection
    The target service collection.
    connectionString: string
    The Oracle database connection string.
    tableName: string
    The table name for process records (defaults to 'PROCESS_INSTANCES').

    Returns: The `services` instance for method chaining.

    Type parameters: TState: The strongly typed domain state type. Exceptions: ArgumentNullException: `services` is `null`; ArgumentException: `connectionString` is `null` or white-space

EricksonLopez.Processes.Storage.PostgreSql#

2
class

PostgreSqlProcessStore<TState>

Assembly: EricksonLopez.Processes.Storage.PostgreSql
public sealed partial class PostgreSqlProcessStore<TState> : IProcessStore<TState> where TState : notnull
Implements: IProcessStore<TState>

Provides a PostgreSQL implementation of `IProcessStore<TState>` using raw parameterized Npgsql commands and JSONB payloads.

Remarks:

Type parameters: TState: The process domain state type.

Members (8)

  • constructorPostgreSqlProcessStore
    public PostgreSqlProcessStore(string connectionString, IProcessStateSerializer<TState> serializer, string tableName = "", ILogger<PostgreSqlProcessStore<TState>>? logger = null)

    Initializes a new instance of the `PostgreSqlProcessStore<TState>` class with the specified connection string and serializer.

    connectionString: string
    The PostgreSQL connection string.
    serializer: IProcessStateSerializer<TState>
    The state serializer instance.
    tableName: string
    The table name for process instances (defaults to 'process_instances').
    logger: ILogger<PostgreSqlProcessStore<TState>>?
    The optional logger instance, or `null`.

    Exceptions: ArgumentException: `connectionString` or `tableName` is `null` or white-space; ArgumentNullException: `serializer` is `null`

  • methodBeginConnectionScopeAsync
    public ValueTask<IAsyncDisposable?> BeginConnectionScopeAsync(CancellationToken cancellationToken = default)

    Begins an optional connection-leasing scope across an execution or retry cycle to avoid connection pool churn.

    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains an `IAsyncDisposable` scope, or `null` if connection scoping is not used by the store.

  • methodExistsAsync
    public async ValueTask<bool> ExistsAsync(ProcessId id, CancellationToken cancellationToken = default)

    Determines whether a process instance with the specified identifier exists in storage.

    id: ProcessId
    The unique process identifier.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains `true` if the instance exists; otherwise, `false`.

  • methodGetByCorrelationIdAsync
    public async ValueTask<ProcessInstance<TState>?> GetByCorrelationIdAsync(CorrelationId correlationId, CancellationToken cancellationToken = default)

    Retrieves a process instance by its business correlation identifier.

    correlationId: CorrelationId
    The business correlation identifier.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains the matching `ProcessInstance<TState>`, or `null` if not found.

  • methodGetByIdAsync
    public async ValueTask<ProcessInstance<TState>?> GetByIdAsync(ProcessId id, CancellationToken cancellationToken = default)

    Retrieves a process instance by its unique identifier.

    id: ProcessId
    The unique process identifier.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains the persisted `ProcessInstance<TState>`, or `null` if not found.

  • methodSaveAsync
    public async ValueTask<ProcessSaveResult> SaveAsync(ProcessInstance<TState> instance, CancellationToken cancellationToken = default)

    Persists a new or updated process instance using optimistic concurrency control.

    instance: ProcessInstance<TState>
    The process instance to save.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains a `ProcessSaveResult` indicating the outcome.

  • propertyConnectionOpenCount
    public int ConnectionOpenCount { get; }

    Gets the total number of physical database connections opened by this store instance.

  • propertyQuotedTableName
    public string QuotedTableName { get; }

    Gets the properly double-quoted PostgreSQL table identifier (supporting schema.table qualification).

class

ProcessPostgreSqlServiceCollectionExtensions

Assembly: EricksonLopez.Processes.Storage.PostgreSql
public static class ProcessPostgreSqlServiceCollectionExtensions

Provides extension methods for registering PostgreSQL process store persistence with an `IServiceCollection`.

Members (1)

  • methodAddPostgreSqlProcessStore<TState>
    public static IServiceCollection AddPostgreSqlProcessStore<TState>(this IServiceCollection services, string connectionString, string tableName = "") where TState : notnull

    Registers `PostgreSqlProcessStore<TState>` as the implementation of `IProcessStore<TState>` in the service collection.

    services: this IServiceCollection
    The target service collection.
    connectionString: string
    The PostgreSQL database connection string.
    tableName: string
    The table name for process records (defaults to 'process_instances').

    Returns: The `services` instance for method chaining.

    Type parameters: TState: The strongly typed domain state type. Exceptions: ArgumentNullException: `services` is `null`; ArgumentException: `connectionString` is `null` or white-space

EricksonLopez.Processes.Storage.SqlServer#

3
class

ProcessSqlServerServiceCollectionExtensions

Assembly: EricksonLopez.Processes.Storage.SqlServer
public static class ProcessSqlServerServiceCollectionExtensions

Provides extension methods for registering SQL Server process store persistence with an `IServiceCollection`.

Members (1)

  • methodAddSqlServerProcessStore<TState>
    public static IServiceCollection AddSqlServerProcessStore<TState>(this IServiceCollection services, string connectionString, string tableName = "") where TState : notnull

    Registers `SqlServerProcessStore<TState>` as the implementation of `IProcessStore<TState>` in the service collection.

    services: this IServiceCollection
    The target service collection.
    connectionString: string
    The SQL Server database connection string.
    tableName: string
    The table name for process records (defaults to 'ProcessInstances').

    Returns: The `services` instance for method chaining.

    Type parameters: TState: The strongly typed domain state type. Exceptions: ArgumentNullException: `services` is `null`; ArgumentException: `connectionString` is `null` or white-space

class

SqlServerProcessStore<TState>

Assembly: EricksonLopez.Processes.Storage.SqlServer
public sealed partial class SqlServerProcessStore<TState> : IProcessStore<TState> where TState : notnull
Implements: IProcessStore<TState>

Provides a SQL Server implementation of `IProcessStore<TState>` using raw parameterized SqlClient commands and serialized JSON payloads.

Remarks:

Type parameters: TState: The process domain state type.

Members (8)

  • constructorSqlServerProcessStore
    public SqlServerProcessStore(string connectionString, IProcessStateSerializer<TState> serializer, string tableName = "", ILogger<SqlServerProcessStore<TState>>? logger = null)

    Initializes a new instance of the `SqlServerProcessStore<TState>` class with the specified connection string and serializer.

    connectionString: string
    The SQL Server connection string.
    serializer: IProcessStateSerializer<TState>
    The state serializer instance.
    tableName: string
    The table name for process instances (defaults to 'ProcessInstances').
    logger: ILogger<SqlServerProcessStore<TState>>?
    The optional logger instance, or `null`.

    Exceptions: ArgumentException: `connectionString` or `tableName` is `null` or white-space; ArgumentNullException: `serializer` is `null`

  • methodBeginConnectionScopeAsync
    public ValueTask<IAsyncDisposable?> BeginConnectionScopeAsync(CancellationToken cancellationToken = default)

    Begins an optional connection-leasing scope across an execution or retry cycle to avoid connection pool churn.

    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains an `IAsyncDisposable` scope, or `null` if connection scoping is not used by the store.

  • methodExistsAsync
    public async ValueTask<bool> ExistsAsync(ProcessId id, CancellationToken cancellationToken = default)

    Determines whether a process instance with the specified identifier exists in storage.

    id: ProcessId
    The unique process identifier.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains `true` if the instance exists; otherwise, `false`.

  • methodGetByCorrelationIdAsync
    public async ValueTask<ProcessInstance<TState>?> GetByCorrelationIdAsync(CorrelationId correlationId, CancellationToken cancellationToken = default)

    Retrieves a process instance by its business correlation identifier.

    correlationId: CorrelationId
    The business correlation identifier.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains the matching `ProcessInstance<TState>`, or `null` if not found.

  • methodGetByIdAsync
    public async ValueTask<ProcessInstance<TState>?> GetByIdAsync(ProcessId id, CancellationToken cancellationToken = default)

    Retrieves a process instance by its unique identifier.

    id: ProcessId
    The unique process identifier.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains the persisted `ProcessInstance<TState>`, or `null` if not found.

  • methodSaveAsync
    public async ValueTask<ProcessSaveResult> SaveAsync(ProcessInstance<TState> instance, CancellationToken cancellationToken = default)

    Persists a new or updated process instance using optimistic concurrency control.

    instance: ProcessInstance<TState>
    The process instance to save.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains a `ProcessSaveResult` indicating the outcome.

  • propertyConnectionOpenCount
    public int ConnectionOpenCount { get; }

    Gets the total number of physical database connections opened by this store instance.

  • propertyQuotedTableName
    public string QuotedTableName { get; }

    Gets the properly bracket-quoted SQL Server table identifier (supporting schema.table qualification).

class

SqlServerStorageOptions

Assembly: EricksonLopez.Processes.Storage.SqlServer
public sealed class SqlServerStorageOptions

Provides configuration and cross-platform TLS diagnostic options for `SqlServerProcessStore<TState>`.

Members (3)

  • methodValidateCrossPlatformTlsConfiguration
    public static bool ValidateCrossPlatformTlsConfiguration(string connectionString, ILogger? logger, bool simulateNonWindows = false)

    Inspects the SQL Server connection string and emits a diagnostic warning if running on non-Windows with `Encrypt=True` and `TrustServerCertificate=False`, where managed SNI and OpenSSL 3.0 may reject self-signed or container SQL Server certificates.

    connectionString: string
    The SQL Server connection string to inspect.
    logger: ILogger?
    The logger used to emit diagnostic warnings.
    simulateNonWindows: bool
    Optional flag for testing non-Windows TLS diagnostics on Windows hosts.

    Returns: `true` if a potential cross-platform SNI TLS certificate warning was emitted; otherwise, `false`.

  • propertyConnectionString
    public string ConnectionString { get; set; }

    Gets or sets the SQL Server connection string.

  • propertyTableName
    public string TableName { get; set; }

    Gets or sets the table name for process instances (supports schema qualification such as `dbo.ProcessInstances`).

EricksonLopez.Processes.Storage.Sqlite#

4
class

ProcessSqliteServiceCollectionExtensions

Assembly: EricksonLopez.Processes.Storage.Sqlite
public static class ProcessSqliteServiceCollectionExtensions

Provides extension methods for registering SQLite process store persistence with an `IServiceCollection`.

Members (1)

  • methodAddSqliteProcessStore<TState>
    public static IServiceCollection AddSqliteProcessStore<TState>(this IServiceCollection services, string connectionString, string tableName = "") where TState : notnull

    Registers `SqliteProcessStore<TState>` as the implementation of `IProcessStore<TState>` in the service collection.

    services: this IServiceCollection
    The target service collection.
    connectionString: string
    The SQLite database connection string.
    tableName: string
    The table name for process records (defaults to 'ProcessInstances').

    Returns: The `services` instance for method chaining.

    Type parameters: TState: The strongly typed domain state type. Exceptions: ArgumentNullException: `services` is `null`; ArgumentException: `connectionString` is `null` or white-space

class

SqliteProcessStore<TState>

Assembly: EricksonLopez.Processes.Storage.Sqlite
public sealed partial class SqliteProcessStore<TState> : IProcessStore<TState> where TState : notnull
Implements: IProcessStore<TState>

Provides a SQLite implementation of `IProcessStore<TState>` using raw parameterized SQLite commands and serialized JSON payloads.

Remarks:

Type parameters: TState: The process domain state type.

Members (8)

  • constructorSqliteProcessStore
    public SqliteProcessStore(string connectionString, IProcessStateSerializer<TState> serializer, string tableName = "", ILogger<SqliteProcessStore<TState>>? logger = null, string? allowedRootDirectory = null)

    Initializes a new instance of the `SqliteProcessStore<TState>` class with the specified connection string and serializer.

    connectionString: string
    The SQLite database connection string.
    serializer: IProcessStateSerializer<TState>
    The state serializer instance.
    tableName: string
    The table name for process instances (defaults to 'ProcessInstances').
    logger: ILogger<SqliteProcessStore<TState>>?
    The optional logger instance, or `null`.
    allowedRootDirectory: string?
    The optional allowed root directory for file-based SQLite databases.

    Exceptions: ArgumentException: `connectionString` or `tableName` is `null` or white-space; ArgumentNullException: `serializer` is `null`; UnauthorizedAccessException: The database path traverses outside the allowed root directory

  • methodBeginConnectionScopeAsync
    public ValueTask<IAsyncDisposable?> BeginConnectionScopeAsync(CancellationToken cancellationToken = default)

    Begins an optional connection-leasing scope across an execution or retry cycle to avoid connection pool churn.

    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains an `IAsyncDisposable` scope, or `null` if connection scoping is not used by the store.

  • methodExistsAsync
    public async ValueTask<bool> ExistsAsync(ProcessId id, CancellationToken cancellationToken = default)

    Determines whether a process instance with the specified identifier exists in storage.

    id: ProcessId
    The unique process identifier.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains `true` if the instance exists; otherwise, `false`.

  • methodGetByCorrelationIdAsync
    public async ValueTask<ProcessInstance<TState>?> GetByCorrelationIdAsync(CorrelationId correlationId, CancellationToken cancellationToken = default)

    Retrieves a process instance by its business correlation identifier.

    correlationId: CorrelationId
    The business correlation identifier.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains the matching `ProcessInstance<TState>`, or `null` if not found.

  • methodGetByIdAsync
    public async ValueTask<ProcessInstance<TState>?> GetByIdAsync(ProcessId id, CancellationToken cancellationToken = default)

    Retrieves a process instance by its unique identifier.

    id: ProcessId
    The unique process identifier.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains the persisted `ProcessInstance<TState>`, or `null` if not found.

  • methodSaveAsync
    public async ValueTask<ProcessSaveResult> SaveAsync(ProcessInstance<TState> instance, CancellationToken cancellationToken = default)

    Persists a new or updated process instance using optimistic concurrency control.

    instance: ProcessInstance<TState>
    The process instance to save.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains a `ProcessSaveResult` indicating the outcome.

  • propertyConnectionOpenCount
    public int ConnectionOpenCount { get; }

    Gets the total number of physical database connections opened by this store instance.

  • propertyQuotedTableName
    public string QuotedTableName { get; }

    Gets the properly quoted SQL table identifier (supporting schema.table qualification).

class

SqliteStorageOptions

Assembly: EricksonLopez.Processes.Storage.Sqlite
public sealed class SqliteStorageOptions

Provides configuration and filesystem security validation options for `SqliteProcessStore<TState>`.

Members (4)

  • methodValidate
    public string Validate()

    Validates and canonicalizes the configured connection string path.

    Returns: The canonicalized SQLite connection string.

  • propertyAllowedRootDirectory
    public string? AllowedRootDirectory { get; set; }

    Gets or sets the optional approved root directory within which file-based SQLite databases must reside.

  • propertyConnectionString
    public string ConnectionString { get; set; }

    Gets or sets the SQLite connection string.

  • propertyTableName
    public string TableName { get; set; }

    Gets or sets the table name for storing process instances. Defaults to `ProcessInstances`.

class

SqliteStorageSecurityValidator

Assembly: EricksonLopez.Processes.Storage.Sqlite
public static class SqliteStorageSecurityValidator

Validates and canonicalizes SQLite file paths to prevent directory traversal (CWE-22).

Members (1)

  • methodSanitizeAndValidatePath
    public static string SanitizeAndValidatePath(string connectionString, string? allowedRootDirectory = null)

    Canonicalizes the `Data Source` path in a SQLite connection string and verifies that it does not traverse outside the allowed root directory.

    connectionString: string
    The raw SQLite connection string.
    allowedRootDirectory: string?
    The optional allowed base directory. When `null`, relative paths containing `..` are restricted to the current working directory.

    Returns: The validated connection string with a canonicalized `Data Source` path.

    Exceptions: ArgumentException: `connectionString` is `null` or white-space; UnauthorizedAccessException: The resolved database file path escapes the allowed root directory

EricksonLopez.Processes.SystemTextJson#

9
class

CausationIdJsonConverter

Assembly: EricksonLopez.Processes.SystemTextJson
public sealed class CausationIdJsonConverter : JsonConverter<CausationId>
Inherits: JsonConverter<CausationId>

Converts `CausationId` instances to or from JSON.

Members (2)

  • methodRead
    public override CausationId Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)

    Inherits documentation from base type or interface.

    reader: ref Utf8JsonReader
    typeToConvert: Type
    options: JsonSerializerOptions
  • methodWrite
    public override void Write(Utf8JsonWriter writer, CausationId value, JsonSerializerOptions options)

    Inherits documentation from base type or interface.

    writer: Utf8JsonWriter
    value: CausationId
    options: JsonSerializerOptions
class

CorrelationIdJsonConverter

Assembly: EricksonLopez.Processes.SystemTextJson
public sealed class CorrelationIdJsonConverter : JsonConverter<CorrelationId>
Inherits: JsonConverter<CorrelationId>

Converts `CorrelationId` instances to or from JSON.

Members (2)

  • methodRead
    public override CorrelationId Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)

    Inherits documentation from base type or interface.

    reader: ref Utf8JsonReader
    typeToConvert: Type
    options: JsonSerializerOptions
  • methodWrite
    public override void Write(Utf8JsonWriter writer, CorrelationId value, JsonSerializerOptions options)

    Inherits documentation from base type or interface.

    writer: Utf8JsonWriter
    value: CorrelationId
    options: JsonSerializerOptions
class

MessageIdJsonConverter

Assembly: EricksonLopez.Processes.SystemTextJson
public sealed class MessageIdJsonConverter : JsonConverter<MessageId>
Inherits: JsonConverter<MessageId>

Converts `MessageId` instances to or from JSON.

Members (2)

  • methodRead
    public override MessageId Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)

    Inherits documentation from base type or interface.

    reader: ref Utf8JsonReader
    typeToConvert: Type
    options: JsonSerializerOptions
  • methodWrite
    public override void Write(Utf8JsonWriter writer, MessageId value, JsonSerializerOptions options)

    Inherits documentation from base type or interface.

    writer: Utf8JsonWriter
    value: MessageId
    options: JsonSerializerOptions
class

ProcessIdJsonConverter

Assembly: EricksonLopez.Processes.SystemTextJson
public sealed class ProcessIdJsonConverter : JsonConverter<ProcessId>
Inherits: JsonConverter<ProcessId>

Converts `ProcessId` instances to or from JSON.

Members (2)

  • methodRead
    public override ProcessId Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)

    Inherits documentation from base type or interface.

    reader: ref Utf8JsonReader
    typeToConvert: Type
    options: JsonSerializerOptions
  • methodWrite
    public override void Write(Utf8JsonWriter writer, ProcessId value, JsonSerializerOptions options)

    Inherits documentation from base type or interface.

    writer: Utf8JsonWriter
    value: ProcessId
    options: JsonSerializerOptions
class

ProcessJsonSerializerOptions

Assembly: EricksonLopez.Processes.SystemTextJson
public static class ProcessJsonSerializerOptions

Provides options configuring custom JSON converters for process primitives and identifiers.

Members (2)

  • methodConfigure
    public static JsonSerializerOptions Configure(JsonSerializerOptions options)

    Configures the specified `JsonSerializerOptions` with custom converters for all process primitives.

    options: JsonSerializerOptions
    The JSON serializer options to configure.

    Returns: The configured `JsonSerializerOptions` instance.

    Exceptions: ArgumentNullException: `options` is `null`

  • methodCreate
    public static JsonSerializerOptions Create(IJsonTypeInfoResolver? typeInfoResolver = null)

    Creates a new `JsonSerializerOptions` pre-configured with all process converters and an optional type resolver.

    typeInfoResolver: IJsonTypeInfoResolver?
    The optional JSON type info resolver, or `null`.

    Returns: A new pre-configured `JsonSerializerOptions` instance.

class

ProcessTypeJsonConverter

Assembly: EricksonLopez.Processes.SystemTextJson
public sealed class ProcessTypeJsonConverter : JsonConverter<ProcessType>
Inherits: JsonConverter<ProcessType>

Converts `ProcessType` instances to or from JSON.

Members (2)

  • methodRead
    public override ProcessType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)

    Inherits documentation from base type or interface.

    reader: ref Utf8JsonReader
    typeToConvert: Type
    options: JsonSerializerOptions
  • methodWrite
    public override void Write(Utf8JsonWriter writer, ProcessType value, JsonSerializerOptions options)

    Inherits documentation from base type or interface.

    writer: Utf8JsonWriter
    value: ProcessType
    options: JsonSerializerOptions
class

ProcessVersionJsonConverter

Assembly: EricksonLopez.Processes.SystemTextJson
public sealed class ProcessVersionJsonConverter : JsonConverter<ProcessVersion>
Inherits: JsonConverter<ProcessVersion>

Converts `ProcessVersion` instances to or from JSON.

Members (2)

  • methodRead
    public override ProcessVersion Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)

    Inherits documentation from base type or interface.

    reader: ref Utf8JsonReader
    typeToConvert: Type
    options: JsonSerializerOptions
  • methodWrite
    public override void Write(Utf8JsonWriter writer, ProcessVersion value, JsonSerializerOptions options)

    Inherits documentation from base type or interface.

    writer: Utf8JsonWriter
    value: ProcessVersion
    options: JsonSerializerOptions
class

RevisionJsonConverter

Assembly: EricksonLopez.Processes.SystemTextJson
public sealed class RevisionJsonConverter : JsonConverter<Revision>
Inherits: JsonConverter<Revision>

Converts `Revision` instances to or from JSON.

Members (2)

  • methodRead
    public override Revision Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)

    Inherits documentation from base type or interface.

    reader: ref Utf8JsonReader
    typeToConvert: Type
    options: JsonSerializerOptions
  • methodWrite
    public override void Write(Utf8JsonWriter writer, Revision value, JsonSerializerOptions options)

    Inherits documentation from base type or interface.

    writer: Utf8JsonWriter
    value: Revision
    options: JsonSerializerOptions
class

SystemTextJsonProcessStateSerializer<TState>

Assembly: EricksonLopez.Processes.SystemTextJson
public sealed class SystemTextJsonProcessStateSerializer<TState> : IProcessStateSerializer<TState> where TState : notnull
Implements: IProcessStateSerializer<TState>

Provides a JSON state serializer utilizing compile-time `JsonTypeInfo<T>` metadata.

Remarks:

Type parameters: TState: The process state type.

Members (6)

  • constructorSystemTextJsonProcessStateSerializer
    public SystemTextJsonProcessStateSerializer(JsonTypeInfo<TState> jsonTypeInfo)

    Initializes a new instance of the `SystemTextJsonProcessStateSerializer<TState>` class with the specified type metadata and the default 64 KB payload limit (`DefaultMaxPayloadSizeBytes`).

    jsonTypeInfo: JsonTypeInfo<TState>
    The source-generated `JsonTypeInfo<TState>` metadata.

    Exceptions: ArgumentNullException: `jsonTypeInfo` is `null`

  • constructorSystemTextJsonProcessStateSerializer
    public SystemTextJsonProcessStateSerializer(JsonTypeInfo<TState> jsonTypeInfo, int? maxPayloadSizeBytes)

    Initializes a new instance of the `SystemTextJsonProcessStateSerializer<TState>` class with the specified type metadata and optional payload size limit.

    jsonTypeInfo: JsonTypeInfo<TState>
    The source-generated `JsonTypeInfo<TState>` metadata.
    maxPayloadSizeBytes: int?
    The maximum allowed payload size in bytes, or `null` for unlimited.

    Exceptions: ArgumentNullException: `jsonTypeInfo` is `null`; ArgumentOutOfRangeException: `maxPayloadSizeBytes` is less than or equal to zero

  • methodDeserialize
    public TState Deserialize(ReadOnlySpan<byte> data)

    Deserializes the byte span into a process state instance.

    data: ReadOnlySpan<byte>
    The serialized byte span to deserialize.

    Returns: The deserialized process state instance.

    Exceptions: InvalidOperationException: The incoming payload size exceeds `MaxPayloadSizeBytes`; JsonException: The deserialized payload is `null`

  • methodSerialize
    public byte[] Serialize(TState state)

    Serializes the specified state instance into a byte array.

    state: TState
    The process state instance to serialize.

    Returns: The serialized byte array.

    Exceptions: ArgumentNullException: `state` is `null`; InvalidOperationException: The serialized payload size exceeds `MaxPayloadSizeBytes`

  • propertyMaxPayloadSizeBytes
    public int? MaxPayloadSizeBytes { get; }

    Gets the maximum allowed payload size in bytes, or `null` if no arbitrary limit is enforced.

  • fieldDefaultMaxPayloadSizeBytes
    public const int DefaultMaxPayloadSizeBytes

    Specifies the default maximum allowed payload size in bytes (64 KB) when not explicitly specified.

EricksonLopez.Processes.Testing#

2
class

FaultInjectingProcessStore<TState>

Assembly: EricksonLopez.Processes.Testing
public sealed class FaultInjectingProcessStore<TState> : IProcessStore<TState> where TState : notnull
Implements: IProcessStore<TState>

Provides an in-memory test store decorator that injects simulated faults, concurrency conflicts, or forced errors for resilience testing.

Remarks:

Type parameters: TState: The strongly typed process state type.

Members (14)

  • constructorFaultInjectingProcessStore
    public FaultInjectingProcessStore(IProcessStore<TState>? innerStore = null)

    Initializes a new instance of the `FaultInjectingProcessStore<TState>` class with an optional inner store.

    innerStore: IProcessStore<TState>?
    The underlying process store, or `null` to create an `InMemoryProcessStore<TState>`.
  • methodExistsAsync
    public ValueTask<bool> ExistsAsync(ProcessId id, CancellationToken cancellationToken = default)

    Determines whether a process instance with the specified identifier exists in storage.

    id: ProcessId
    The unique process identifier.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains `true` if the instance exists; otherwise, `false`.

  • methodGetByCorrelationIdAsync
    public ValueTask<ProcessInstance<TState>?> GetByCorrelationIdAsync(CorrelationId correlationId, CancellationToken cancellationToken = default)

    Retrieves a process instance by its business correlation identifier.

    correlationId: CorrelationId
    The business correlation identifier.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains the matching `ProcessInstance<TState>`, or `null` if not found.

  • methodGetByIdAsync
    public ValueTask<ProcessInstance<TState>?> GetByIdAsync(ProcessId id, CancellationToken cancellationToken = default)

    Retrieves a process instance by its unique identifier.

    id: ProcessId
    The unique process identifier.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains the persisted `ProcessInstance<TState>`, or `null` if not found.

  • methodSaveAsync
    public ValueTask<ProcessSaveResult> SaveAsync(ProcessInstance<TState> instance, CancellationToken cancellationToken = default)

    Persists a new or updated process instance using optimistic concurrency control.

    instance: ProcessInstance<TState>
    The process instance to save.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains a `ProcessSaveResult` indicating the outcome.

  • propertyConcurrencyConflictsToSimulate
    public int ConcurrencyConflictsToSimulate { get; set; }

    Gets or sets the number of transient concurrency conflict results to simulate on successive saves.

  • propertyExceptionToThrowOnExists
    public Exception? ExceptionToThrowOnExists { get; set; }

    Gets or sets an exception to throw unconditionally during `ExistsAsync`.

  • propertyExceptionToThrowOnGet
    public Exception? ExceptionToThrowOnGet { get; set; }

    Gets or sets an exception to throw unconditionally during `GetByIdAsync`.

  • propertyExceptionToThrowOnGetByCorrelationId
    public Exception? ExceptionToThrowOnGetByCorrelationId { get; set; }

    Gets or sets an exception to throw unconditionally during `GetByCorrelationIdAsync`.

  • propertyExceptionToThrowOnSave
    public Exception? ExceptionToThrowOnSave { get; set; }

    Gets or sets an exception to throw unconditionally during `SaveAsync`.

  • propertyForcedExistsResult
    public bool? ForcedExistsResult { get; set; }

    Gets or sets a forced result to return unconditionally during `ExistsAsync`.

  • propertyForcedGetByCorrelationIdResult
    public ProcessInstance<TState>? ForcedGetByCorrelationIdResult { get; set; }

    Gets or sets a forced result to return unconditionally during `GetByCorrelationIdAsync`.

  • propertyForcedSaveResult
    public ProcessSaveResult? ForcedSaveResult { get; set; }

    Gets or sets a forced `ProcessSaveResult` to return unconditionally on saves.

  • propertyInnerStore
    public IProcessStore<TState> InnerStore { get; }

    Gets the underlying wrapped `IProcessStore<TState>`.

class

InMemoryProcessStore<TState>

Assembly: EricksonLopez.Processes.Testing
public sealed class InMemoryProcessStore<TState> : IProcessStore<TState> where TState : notnull
Implements: IProcessStore<TState>

Provides a thread-safe in-memory store simulating atomic optimistic concurrency control for unit and integration tests.

Remarks:

Type parameters: TState: The state type.

Members (4)

  • methodExistsAsync
    public ValueTask<bool> ExistsAsync(ProcessId id, CancellationToken cancellationToken = default)

    Determines whether a process instance with the specified identifier exists in storage.

    id: ProcessId
    The unique process identifier.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains `true` if the instance exists; otherwise, `false`.

  • methodGetByCorrelationIdAsync
    public ValueTask<ProcessInstance<TState>?> GetByCorrelationIdAsync(CorrelationId correlationId, CancellationToken cancellationToken = default)

    Retrieves a process instance by its business correlation identifier.

    correlationId: CorrelationId
    The business correlation identifier.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains the matching `ProcessInstance<TState>`, or `null` if not found.

  • methodGetByIdAsync
    public ValueTask<ProcessInstance<TState>?> GetByIdAsync(ProcessId id, CancellationToken cancellationToken = default)

    Retrieves a process instance by its unique identifier.

    id: ProcessId
    The unique process identifier.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains the persisted `ProcessInstance<TState>`, or `null` if not found.

  • methodSaveAsync
    public ValueTask<ProcessSaveResult> SaveAsync(ProcessInstance<TState> instance, CancellationToken cancellationToken = default)

    Persists a new or updated process instance using optimistic concurrency control.

    instance: ProcessInstance<TState>
    The process instance to save.
    cancellationToken: CancellationToken
    A token that can be used to cancel the asynchronous operation.

    Returns: A value task representing the asynchronous operation. The task result contains a `ProcessSaveResult` indicating the outcome.

EricksonLopez.Processes.Testing.Doubles#

12
record

Address

Assembly: EricksonLopez.Processes.Testing
public sealed record Address(string Street, string City, string Country)

Represents a nested address model for complex storage tests.

Members (4)

  • constructorAddress
    public Address(string Street, string City, string Country)

    Initializes a new instance of Address.

    Street: string
    The street address.
    City: string
    The city name.
    Country: string
    The country name.
  • propertyCity
    public string City { get; init; }

    The city name.

  • propertyCountry
    public string Country { get; init; }

    The country name.

  • propertyStreet
    public string Street { get; init; }

    The street address.

record

ComplexOrderState

Assembly: EricksonLopez.Processes.Testing
public sealed record ComplexOrderState(string CustomerId, Address BillingAddress, Address ShippingAddress, Dictionary<string, string> Metadata, List<OrderItem> Items) : IProcessState
Implements: IProcessState

Represents a complex order domain state containing nested objects and collections for storage tests.

Members (6)

  • constructorComplexOrderState
    public ComplexOrderState(string CustomerId, Address BillingAddress, Address ShippingAddress, Dictionary<string, string> Metadata, List<OrderItem> Items)

    Initializes a new instance of ComplexOrderState.

    CustomerId: string
    The customer identifier.
    BillingAddress: Address
    The billing address details.
    ShippingAddress: Address
    The shipping address details.
    Metadata: Dictionary<string, string>
    The key-value metadata dictionary.
    Items: List<OrderItem>
    The list of line items in the order.
  • propertyBillingAddress
    public Address BillingAddress { get; init; }

    The billing address details.

  • propertyCustomerId
    public string CustomerId { get; init; }

    The customer identifier.

  • propertyItems
    public List<OrderItem> Items { get; init; }

    The list of line items in the order.

  • propertyMetadata
    public Dictionary<string, string> Metadata { get; init; }

    The key-value metadata dictionary.

  • propertyShippingAddress
    public Address ShippingAddress { get; init; }

    The shipping address details.

record

OrderItem

Assembly: EricksonLopez.Processes.Testing
public sealed record OrderItem(string Sku, int Quantity, decimal UnitPrice)

Represents a nested order line item for storage tests.

Members (4)

  • constructorOrderItem
    public OrderItem(string Sku, int Quantity, decimal UnitPrice)

    Initializes a new instance of OrderItem.

    Sku: string
    The product SKU identifier.
    Quantity: int
    The ordered quantity.
    UnitPrice: decimal
    The unit price amount.
  • propertyQuantity
    public int Quantity { get; init; }

    The ordered quantity.

  • propertySku
    public string Sku { get; init; }

    The product SKU identifier.

  • propertyUnitPrice
    public decimal UnitPrice { get; init; }

    The unit price amount.

record

SampleOrderState

Assembly: EricksonLopez.Processes.Testing
public sealed record SampleOrderState(string CustomerId, decimal TotalAmount, bool IsDelivered) : IProcessState
Implements: IProcessState

Represents a sample order domain state for storage integration tests.

Members (4)

  • constructorSampleOrderState
    public SampleOrderState(string CustomerId, decimal TotalAmount, bool IsDelivered)

    Initializes a new instance of SampleOrderState.

    CustomerId: string
    The customer identifier.
    TotalAmount: decimal
    The total monetary amount.
    IsDelivered: bool
    A value indicating whether the order is delivered.
  • propertyCustomerId
    public string CustomerId { get; init; }

    The customer identifier.

  • propertyIsDelivered
    public bool IsDelivered { get; init; }

    A value indicating whether the order is delivered.

  • propertyTotalAmount
    public decimal TotalAmount { get; init; }

    The total monetary amount.

class

SharedStorageTestJsonContext

Assembly: EricksonLopez.Processes.Testing
public sealed partial class SharedStorageTestJsonContext : JsonSerializerContext
Inherits: JsonSerializerContext

Provides JSON serialization metadata for storage test models.

Members (0)

This type declares 0 public members (e.g. marker interface or empty enum/record).

record

TestCounterState

Assembly: EricksonLopez.Processes.Testing
public sealed record TestCounterState(int Count) : IProcessState
Implements: IProcessState

Represents a numeric counter process state for concurrency and optimistic concurrency testing.

Members (2)

  • constructorTestCounterState
    public TestCounterState(int Count = 0)

    Initializes a new instance of TestCounterState.

    Count: int
    The current counter value.
  • propertyCount
    public int Count { get; init; }

    The current counter value.

class

TestIncrementCorrelation

Assembly: EricksonLopez.Processes.Testing
public sealed class TestIncrementCorrelation : IProcessCorrelation<TestIncrementEvent>
Implements: IProcessCorrelation<TestIncrementEvent>

Provides correlation extraction logic for `TestIncrementEvent`.

Members (2)

  • methodExtractCorrelationId
    public CorrelationId ExtractCorrelationId(TestIncrementEvent event)

    Extracts the business correlation identifier from the specified event.

    event: TestIncrementEvent
    The incoming event instance.

    Returns: The target `CorrelationId`.

  • methodExtractProcessId
    public ProcessId ExtractProcessId(TestIncrementEvent event)

    Extracts the process instance identifier from the specified event.

    event: TestIncrementEvent
    The incoming event instance.

    Returns: The target `ProcessId`.

record

TestIncrementEvent

Assembly: EricksonLopez.Processes.Testing
public sealed record TestIncrementEvent(ProcessId TargetId, int Delta)

Represents a domain event for incrementing a test counter process.

Members (3)

  • constructorTestIncrementEvent
    public TestIncrementEvent(ProcessId TargetId, int Delta = 1)

    Initializes a new instance of TestIncrementEvent.

    TargetId: ProcessId
    The target process identifier.
    Delta: int
    The amount to increment.
  • propertyDelta
    public int Delta { get; init; }

    The amount to increment.

  • propertyTargetId
    public ProcessId TargetId { get; init; }

    The target process identifier.

class

TestOrderCreatedCorrelation

Assembly: EricksonLopez.Processes.Testing
public sealed class TestOrderCreatedCorrelation : IProcessCorrelation<TestOrderCreatedEvent>
Implements: IProcessCorrelation<TestOrderCreatedEvent>

Provides correlation extraction logic for `TestOrderCreatedEvent`.

Members (2)

  • methodExtractCorrelationId
    public CorrelationId ExtractCorrelationId(TestOrderCreatedEvent event)

    Extracts the business correlation identifier from the specified event.

    event: TestOrderCreatedEvent
    The incoming event instance.

    Returns: The target `CorrelationId`.

  • methodExtractProcessId
    public ProcessId ExtractProcessId(TestOrderCreatedEvent event)

    Extracts the process instance identifier from the specified event.

    event: TestOrderCreatedEvent
    The incoming event instance.

    Returns: The target `ProcessId`.

record

TestOrderCreatedEvent

Assembly: EricksonLopez.Processes.Testing
public sealed record TestOrderCreatedEvent(Guid OrderId, decimal Amount)

Represents a domain event for the creation of a test order.

Members (3)

  • constructorTestOrderCreatedEvent
    public TestOrderCreatedEvent(Guid OrderId, decimal Amount)

    Initializes a new instance of TestOrderCreatedEvent.

    OrderId: Guid
    The process and order identifier.
    Amount: decimal
    The initial order amount.
  • propertyAmount
    public decimal Amount { get; init; }

    The initial order amount.

  • propertyOrderId
    public Guid OrderId { get; init; }

    The process and order identifier.

record

TestOrderPaidEvent

Assembly: EricksonLopez.Processes.Testing
public sealed record TestOrderPaidEvent(Guid OrderId)

Represents a domain event for payment completion of a test order.

Members (2)

  • constructorTestOrderPaidEvent
    public TestOrderPaidEvent(Guid OrderId)

    Initializes a new instance of TestOrderPaidEvent.

    OrderId: Guid
    The process and order identifier.
  • propertyOrderId
    public Guid OrderId { get; init; }

    The process and order identifier.

record

TestOrderState

Assembly: EricksonLopez.Processes.Testing
public sealed record TestOrderState(string OrderId, decimal Amount, bool IsPaid, bool IsCompleted) : IProcessState
Implements: IProcessState

Represents a reusable order process domain state for unit and integration testing.

Members (5)

  • constructorTestOrderState
    public TestOrderState(string OrderId, decimal Amount = 0m, bool IsPaid = false, bool IsCompleted = false)

    Initializes a new instance of TestOrderState.

    OrderId: string
    The order identifier string.
    Amount: decimal
    The total order amount.
    IsPaid: bool
    A value indicating whether payment has been captured.
    IsCompleted: bool
    A value indicating whether the order lifecycle has completed.
  • propertyAmount
    public decimal Amount { get; init; }

    The total order amount.

  • propertyIsCompleted
    public bool IsCompleted { get; init; }

    A value indicating whether the order lifecycle has completed.

  • propertyIsPaid
    public bool IsPaid { get; init; }

    A value indicating whether payment has been captured.

  • propertyOrderId
    public string OrderId { get; init; }

    The order identifier string.

Microsoft.Extensions.DependencyInjection#

2
class

ProcessMediatorServiceCollectionExtensions

Assembly: EricksonLopez.Processes.Mediator
public static class ProcessMediatorServiceCollectionExtensions

Provides extension methods for registering mediator process dispatcher services with `IServiceCollection`.

Members (2)

  • methodAddProcessesMediator
    public static IServiceCollection AddProcessesMediator(this IServiceCollection services)

    Registers the `IMediatorProcessDispatcher` implementation into the service collection.

    services: this IServiceCollection
    The target service collection.

    Returns: The `services` instance for method chaining.

    Exceptions: ArgumentNullException: `services` is `null`

  • methodAddProcessesMediator
    public static IServiceCollection AddProcessesMediator(this IServiceCollection services, Action<MediatorProcessDispatcherOptions> configure)

    Registers the `IMediatorProcessDispatcher` implementation and configures decoupled payload adaptation options.

    services: this IServiceCollection
    The target service collection.
    configure: Action<MediatorProcessDispatcherOptions>
    A delegate to configure `MediatorProcessDispatcherOptions`.

    Returns: The `services` instance for method chaining.

    Exceptions: ArgumentNullException: `services` or `configure` is `null`

class

ProcessOutboxServiceCollectionExtensions

Assembly: EricksonLopez.Processes.Outbox
public static class ProcessOutboxServiceCollectionExtensions

Provides extension methods for registering transactional outbox dispatching services with `IServiceCollection`.

Members (1)

  • methodAddProcessesOutbox
    public static IServiceCollection AddProcessesOutbox(this IServiceCollection services)

    Registers the `IProcessOutboxDispatcher` implementation into the service collection.

    services: this IServiceCollection
    The target service collection.

    Returns: The `services` instance for method chaining.

    Exceptions: ArgumentNullException: `services` is `null`

Search EricksonLopez.* Ecosystem

Type a library name, NuGet package ID, .NET type, or architectural concept to search across the portal.