CommandCall

A request an AnsweringCommandClient took: the caller it was sent as (null for a client no CommandClient.of gave), and the request. Its results are the ones a target answers it with, on ref: the request's aggregate when it names its type and id, else the ref the test gives.

Properties

Link copied to clipboard
Link copied to clipboard

The request's aggregate, when it names its type and id, in its target tenant or the caller's.

Link copied to clipboard
Link copied to clipboard

The request id the call was sent under: the request's own, else, sent while a decide function decides, the one a node's client derives from the command being decided and the call's index; null for neither.

Functions

Link copied to clipboard
fun committed(version: Int = 1, ref: AggregateRef = required(), results: Map<String, Any> = emptyMap()): CommandResult

The result of the call when its target committed it at version, on ref, with the values its decision answered (results), which the caller reads from CommandResult.results.

Link copied to clipboard
fun failed(code: String, message: String = code, ref: AggregateRef = required()): CommandResult

The result of the call when its target failed it for a technical reason code, on ref.

Link copied to clipboard
fun rejected(code: String, message: String = code, ref: AggregateRef = required(), violations: List<Violation> = emptyList(), extensions: Map<String, Any?> = emptyMap()): CommandResult

The result of the call when its target refused it with code and message, on ref, naming the fields the command broke (violations) and the rejection's structured extensions: the caller reads them from the CommandRejectedException it gets (CommandRejectedException.violations, CommandRejectedException.error).

Link copied to clipboard
open override fun toString(): String