GivenAggregate

An aggregate a processor reads, as ProcessorSpec.givenAggregate gave it: its model replays its history, one commit per event, to the state and version it is at. ProcessorSpec.whenEvent hands over its next commit, and the aggregate is then at it: the next one comes after it, and ProcessorSpec.whenRedelivered and ProcessorSpec.whenDeliveredLate hand it again. A fork of the specification advances a copy of its own, which ProcessorSpec.whenEvent still finds by the aggregate's ref.

A sourcing function that reads the commit of its event reads the commit as stateEvent gives it: committed at DEFAULT_START, of the command command-<version>, in the name of the operator ProcessorSpec.whenEvent names (none in the history).

Constructors

Link copied to clipboard
constructor(model: AggregateModel<S>, ref: AggregateRef, history: List<Any>, scope: Scope)

The aggregate ref of model at the state and version its history leaves it in, one commit per event.

Properties

Link copied to clipboard

The model that evolves the aggregate's state.

Link copied to clipboard

The aggregate.

Link copied to clipboard

The scope its commits leave it in.

Link copied to clipboard
val state: S

The state it is in, replayed anew on each read, as states are mutable.

Link copied to clipboard

The version it is at: one commit per event of its history, then one per commit handed over, by the specification that gave it (a fork advances a copy of its own).