CommandResult

class CommandResult @InternalWowApi constructor(val format: Int = FORMAT, val commandId: String, val requestId: String, val correlationId: String, val ref: AggregateRef, val hop: Hop, val function: FunctionInfo, val status: CommandResult.Status, val version: Int? = null, val duplicate: Boolean = false, val error: ErrorInfo? = null, val results: Map<String, Any> = emptyMap(), val derived: List<String> = emptyList(), val signalTime: Long, val transformedFrom: TransformedFrom? = null, val chainEnded: Boolean = false, val pending: List<Hop> = emptyList())

The one outward result of a command, answered over HTTP and SSE, carried by wait signals and cross-context receipts: what the command reached at one hop of its wait chain.

  • function is who produced it: the command's decide function, or the subscription that handled the commit.

  • version is the aggregate's version after the commit, or the unchanged one.

  • duplicate: the request was already committed, so it was not decided again; results are then empty, since they are only answered by the first commit.

  • error is set when status is Status.REJECTED or Status.FAILED.

  • derived lists, on a saga's hop, the ids of the commands it derived from the commit.

  • signalTime is when it was produced, in epoch milliseconds.

  • transformedFrom is the command the request named when a transformer turned it into this one; null when none did.

  • chainEnded marks the final result of a wait whose chain ended before its plan did: a hop, such as a saga's that derived no command (a declined payment, say), left nothing to reach the plan's later hops. The result stays at that hop, with its own status: it is not the plan's last hop reached. pending lists the hops of the plan that were not reached, in order; it is empty unless chainEnded.

Fields may be added: construct a result with succeeded, rejected or failed, such as a fake of a command gateway answers in a test; the constructor is internal to Wow.

Constructors

Link copied to clipboard
constructor(format: Int = FORMAT, commandId: String, requestId: String, correlationId: String, ref: AggregateRef, hop: Hop, function: FunctionInfo, status: CommandResult.Status, version: Int? = null, duplicate: Boolean = false, error: ErrorInfo? = null, results: Map<String, Any> = emptyMap(), derived: List<String> = emptyList(), signalTime: Long, transformedFrom: TransformedFrom? = null, chainEnded: Boolean = false, pending: List<Hop> = emptyList())

Types

Link copied to clipboard
object Companion
Link copied to clipboard

How a command ended at a hop.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val format: Int
Link copied to clipboard
Link copied to clipboard
val hop: Hop
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val version: Int?

Functions

Link copied to clipboard
fun copyWith(format: Int = this.format, commandId: String = this.commandId, requestId: String = this.requestId, correlationId: String = this.correlationId, ref: AggregateRef = this.ref, hop: Hop = this.hop, function: FunctionInfo = this.function, status: CommandResult.Status = this.status, version: Int? = this.version, duplicate: Boolean = this.duplicate, error: ErrorInfo? = this.error, results: Map<String, Any> = this.results, derived: List<String> = this.derived, signalTime: Long = this.signalTime, transformedFrom: TransformedFrom? = this.transformedFrom, chainEnded: Boolean = this.chainEnded, pending: List<Hop> = this.pending): CommandResult

This CommandResult with the given fields replaced: Wow's own copy, left out of the ABI.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String