UndeclaredEventException

class UndeclaredEventException(val type: AggregateType, val command: Class<*>, val event: Class<*>, message: String) : RuntimeException

A command's handling produced an event its function does not declare: a decide function or an after hook of the model of type produced event for command, outside the events its return type yields or its produces lists, or a lifecycle command's decide function another lifecycle event than its own, a decide function rejected it with a lifecycle event, a model whose owner is fixed (of its tenant, or its id its owner's) transferred its owner (KernelLifecycle.refuseOwnerTransfer), or a decision deleted its aggregate (event AggregateDeleted) and released keys while the kernel's own function restores it, which would bring it back without them (KernelLifecycle.refuseKeylessRestore). A bug in the model, not an outcome of the command: the command fails (wow.command.undeclared-event) and commits nothing.

Constructors

Link copied to clipboard
constructor(type: AggregateType, command: Class<*>, event: Class<*>, message: String)

Properties

Link copied to clipboard
val command: Class<*>
Link copied to clipboard
val event: Class<*>
Link copied to clipboard