CommandResult

data class CommandResult(val id: String, val waitCommandId: String, val stage: CommandStage, val contextName: String, val aggregateName: String, val tenantId: String, val aggregateId: String, val aggregateVersion: Int? = null, val requestId: String, val commandId: String, val function: FunctionInfoData, val errorCode: String = ErrorCodes.SUCCEEDED, val errorMsg: String = ErrorCodes.SUCCEEDED_MESSAGE, val bindingErrors: List<BindingError> = emptyList(), val result: Map<String, Any> = emptyMap(), val signalTime: Long = System.currentTimeMillis()) : Identifier, WaitCommandIdCapable, CommandStageCapable, NamedBoundedContext, AggregateNameCapable, TenantId, NullableAggregateVersionCapable, CommandId, RequestId, ErrorInfo, FunctionInfoCapable<FunctionInfoData> , CommandResultCapable, SignalTimeCapable, Materialized

Represents the result of a command execution, containing all relevant information about the command processing outcome.

CommandResult encapsulates the state of command processing at a specific stage, including success/failure status, aggregate version changes, and any additional result data.

See also

Constructors

Link copied to clipboard
constructor(id: String, waitCommandId: String, stage: CommandStage, contextName: String, aggregateName: String, tenantId: String, aggregateId: String, aggregateVersion: Int? = null, requestId: String, commandId: String, function: FunctionInfoData, errorCode: String = ErrorCodes.SUCCEEDED, errorMsg: String = ErrorCodes.SUCCEEDED_MESSAGE, bindingErrors: List<BindingError> = emptyList(), result: Map<String, Any> = emptyMap(), signalTime: Long = System.currentTimeMillis())

Properties

Link copied to clipboard

the aggregate instance identifier

Link copied to clipboard
open override val aggregateName: String

the aggregate name

Link copied to clipboard
open override val aggregateVersion: Int?

the aggregate version after command processing: - On success: the version after processing - On gateway validation failure: null - On processor execution failure: current aggregate version

Link copied to clipboard
open override val bindingErrors: List<BindingError>

list of binding validation errors

Link copied to clipboard
open override val commandId: String

the command identifier

Link copied to clipboard
open override val contextName: String

the bounded context name

Link copied to clipboard
open override val errorCode: String

error code if processing failed

Link copied to clipboard
open override val errorMsg: String

error message if processing failed

Link copied to clipboard
open override val function: FunctionInfoData

information about the function that processed the command

Link copied to clipboard
open override val id: String

unique identifier for this result

Link copied to clipboard
open override val requestId: String

the request identifier

Link copied to clipboard
open override val result: Map<String, Any>

additional result data as key-value pairs

Link copied to clipboard
open override val signalTime: Long

timestamp when this result was generated

Link copied to clipboard
open override val stage: CommandStage

the current processing stage of the command

Link copied to clipboard
open val succeeded: Boolean
Link copied to clipboard
open override val tenantId: String

the tenant identifier

Link copied to clipboard
open override val waitCommandId: String

the command ID being waited on

Functions

Link copied to clipboard
fun NamedBoundedContext.getContextAlias(boundedContext: BoundedContext? = MetadataSearcher.metadata.contexts[contextName]): String
Link copied to clipboard

Gets the context alias prefix for this bounded context.

Link copied to clipboard