ExecutionReceiptContext

class ExecutionReceiptContext(val executionId: ExecutionId, receiptOf: String, causation: Causation, operator: Operator?, scope: Scope, val ids: Ids = IdGenerators.DEFAULT, headers: Map<String, String> = emptyMap(), commandTypes: CommandTypes = CommandTypes.NONE, contextQueries: ContextQueries = ContextQueries.NONE, codec: EventCodec = EventCodec(), calls: CommandCalls = CommandCalls.NONE, sends: SagaSends? = null) : SagaContext, Derivation

The context of a saga's handler of a receipt: of the rejection of the command receiptOf, by an @OnRejected handler, or of its commit, by an @OnCommitted one. Handling the same receipt again, after a retry or a second delivery, derives the same requests, which the kernel does not decide twice: each command's id and request id are compensationId of receiptOf, this execution, and what it asks (its target, its command type and its business key or occurrence), as a saga's derived commands are keyed (ExecutionSagaContext.derivedId). Each command's causation is the command receiptOf, in the chain of its root (causation), and its operator and scope are that command's, and so are its headers, the request facts it inherited (me.ahoo.wow.api.decide.RequestFacts.PROPAGATED). It schedules, cancels and calls as every saga context does (ExecutionSagaContext): its schedules written by codec, its calls through calls.

Constructors

Link copied to clipboard
constructor(executionId: ExecutionId, receiptOf: String, causation: Causation, operator: Operator?, scope: Scope, ids: Ids = IdGenerators.DEFAULT, headers: Map<String, String> = emptyMap(), commandTypes: CommandTypes = CommandTypes.NONE, contextQueries: ContextQueries = ContextQueries.NONE, codec: EventCodec = EventCodec(), calls: CommandCalls = CommandCalls.NONE, sends: SagaSends? = null)

Types

Link copied to clipboard

Properties

Link copied to clipboard
open override val executionId: ExecutionId
Link copied to clipboard
open override val ids: Ids
Link copied to clipboard
open override val queries: SubscriptionQueries

Functions

Link copied to clipboard
open suspend override fun call(request: CommandRequest<*>): CommandResult
Link copied to clipboard
open override fun cancel(key: String, target: AggregateRef)
Link copied to clipboard
open override fun commandsOf(requests: List<CommandRequest<*>>): List<Command<*>>

The commands of requests, in order, then those schedule and cancel recorded, in the order of the calls.

Link copied to clipboard
open override fun schedule(key: String, rule: ScheduleRule, request: CommandRequest<*>)