Table of Contents

Class SagaPreparedTransition

Namespace
Excalibur.Dispatch.Messaging
Assembly
Excalibur.Dispatch.Abstractions.dll

Owns the exact encoded state and ordered effect inputs of one durable transition attempt.

public sealed class SagaPreparedTransition
Inheritance
SagaPreparedTransition
Inherited Members
Extension Methods

Constructors

SagaPreparedTransition(SagaTransitionIdentity, long, long, long, bool, byte[], IReadOnlyList<SagaPreparedTimerMutation>, IReadOnlyList<IPreparedTransactionalOutboxWrite>, DateTimeOffset?, ISagaAtomicTimeoutParticipant?, bool, SagaTimeoutDeliveryIdentity?)

Initializes a prepared transition, copying state and hashing exact immutable prepared wire values.

public SagaPreparedTransition(SagaTransitionIdentity identity, long expectedVersion, long generation, long firstSequence, bool completed, byte[] encodedState, IReadOnlyList<SagaPreparedTimerMutation> timers, IReadOnlyList<IPreparedTransactionalOutboxWrite> writes, DateTimeOffset? completedAt = null, ISagaAtomicTimeoutParticipant? timeoutParticipant = null, bool isManualTimeout = false, SagaTimeoutDeliveryIdentity? ownedTimeout = null)

Parameters

identity SagaTransitionIdentity

The stable transition identity.

expectedVersion long

The state CAS precondition, included in the digest but not receipt uniqueness.

generation long

The current scheduling generation.

firstSequence long

The first per-saga effect sequence from the loaded scope counter; not a global delivery-order promise.

completed bool

Whether this transition seals its incarnation.

encodedState byte[]

The already-serialized UTF-8 state including its processed marker.

timers IReadOnlyList<SagaPreparedTimerMutation>

The ordered timer mutations.

writes IReadOnlyList<IPreparedTransactionalOutboxWrite>

The ordered owning-provider prepared command/event writes.

completedAt DateTimeOffset?

The original completion timestamp, preserved independently of the encoded state.

timeoutParticipant ISagaAtomicTimeoutParticipant

The selected timer participant, required for timer mutations or owned timeout delivery; absent only with no selected timer store.

isManualTimeout bool

Whether explicit manual-timeout admission must be revalidated at commit.

ownedTimeout SagaTimeoutDeliveryIdentity

The original owned timeout authority, revalidated for every NEW commit.

Properties

Completed

Gets whether the transition seals the incarnation.

public bool Completed { get; }

Property Value

bool

CompletedAt

Gets the original exact completion timestamp, or null.

public DateTimeOffset? CompletedAt { get; }

Property Value

DateTimeOffset?

ExpectedVersion

Gets the state CAS precondition.

public long ExpectedVersion { get; }

Property Value

long

FirstSequence

Gets the first reserved effect sequence.

public long FirstSequence { get; }

Property Value

long

Generation

Gets the current scheduling generation.

public long Generation { get; }

Property Value

long

HasTimerParticipant

Gets whether this attempt captured a selected timer participant.

public bool HasTimerParticipant { get; }

Property Value

bool

Remarks

The provider must refuse omission when its configured profile requires a timer participant.

Identity

Gets the immutable transition identity.

public SagaTransitionIdentity Identity { get; }

Property Value

SagaTransitionIdentity

IsManualTimeout

Gets whether explicit manual-timeout identity admission must be checked again under the commit scope lock.

public bool IsManualTimeout { get; }

Property Value

bool

OwnedTimeout

Gets the immutable original owned timeout authority, or null for nonowned delivery.

public SagaTimeoutDeliveryIdentity? OwnedTimeout { get; }

Property Value

SagaTimeoutDeliveryIdentity

Timers

Gets immutable ordered timer mutations.

public IReadOnlyList<SagaPreparedTimerMutation> Timers { get; }

Property Value

IReadOnlyList<SagaPreparedTimerMutation>

Writes

Gets immutable owning-provider command/event handles.

public IReadOnlyList<IPreparedTransactionalOutboxWrite> Writes { get; }

Property Value

IReadOnlyList<IPreparedTransactionalOutboxWrite>

Methods

GetDigest()

Returns a caller-owned SHA-256 digest of the versioned exact transition representation.

public byte[] GetDigest()

Returns

byte[]

The transition digest.

GetEncodedState()

Returns caller-owned encoded state bytes.

public byte[] GetEncodedState()

Returns

byte[]

The exact copied state bytes.

ValidateTimerParticipant(IDbTransaction, byte[])

Validates selected timer ownership against the actual transaction writer before any writes.

public void ValidateTimerParticipant(IDbTransaction transaction, byte[] actualWriterBinding)

Parameters

transaction IDbTransaction

The actual open provider-owned transaction.

actualWriterBinding byte[]

The trusted kernel encoding of its actual backend and table.