Process Manager
public abstract class ProcessManager<I, S extends EntityState, B extends ValidatingBuilder<S>> extends CommandHandlingEntity<I, S, B> implements EventReactor, Commander, HasVersionColumn<I, S>, HasLifecycleColumns<I, S>
A central processing unit used to maintain the state of the business process and determine the next processing step based on intermediate results.
A process manager reacts to domain events in a cross-aggregate, eventually consistent manner.
Event and command handlers are invoked by the ProcessManagerRepository that manages instances of a process manager class.
For more information on Process Managers, please see:
- Process Manager Pattern
- Clarifying the Saga pattern — the difference between Process Manager and Saga
- Are Sagas and Workflows the same...
- CQRS Journey Guide: A Saga on Sagas
Parameters
<I>
the type of the process manager IDs
<S>
the type of the process manager state
Functions
Link copied to clipboard
Dispatches the command to the handling method.
Link copied to clipboard
Provides error message text for the case of not having an active transaction when a state modification call is made.
Link copied to clipboard
Obtains the model class.
Link copied to clipboard
Obtains classes of the events produced by this object.
Link copied to clipboard
Obtains model class for this entity.
Link copied to clipboard
Obtains the transaction used for modifying the entity.
Inherited functions
Link copied to clipboard
public void afterInvoke(HandlerMethod<? extends Object, ? extends Object, ? extends Object, ? extends Object> method)
A callback for a handler method invocation end.
Link copied to clipboard
public void beforeInvoke(HandlerMethod<? extends Object, ? extends Object, ? extends Object, ? extends Object> method)
A callback for a handler method invocation start.
Link copied to clipboard
Verifies the new entity state and returns ConstraintViolations, if any.
Link copied to clipboard
Ensures that the entity is not marked as
archived
.Link copied to clipboard
Ensures that the entity is not marked as
deleted
.Link copied to clipboard
Clears recent history.
Link copied to clipboard
Obtains the default state of the entity.
Link copied to clipboard
Ensures that the callee is allowed to access Entity's state() method.
Link copied to clipboard
Creates
ValueMismatch
for the case of discovering a non-default value when the default value was expected by a command.Link copied to clipboard
Creates
ValueMismatch
for the case of discovering a non-empty value, when an empty string was expected by a command.Link copied to clipboard
Creates a
ValueMismatch
for a command that wanted to clear a value, but discovered that the field already has the default value.Creates a
ValueMismatch
for a command that wanted to change a field value, but discovered that the field has the default value.Link copied to clipboard
Creates a
ValueMismatch
for a command that wanted to clear a string value but discovered that the field is already empty.Link copied to clipboard
Obtains the value of
archived
flag.Link copied to clipboard
Obtains the value of
deleted
flag.Link copied to clipboard
Obtains the current state of the entity lifecycle flags.
Link copied to clipboard
Obtains the version of the entity.
Link copied to clipboard
Obtains ID of the entity in the string form.
Link copied to clipboard
Tests whether the entity is marked as archived.
Link copied to clipboard
Obtains current lifecycle flags.
Link copied to clipboard
Tells whether lifecycle flags of the entity changed since its initialization.
Link copied to clipboard
The object identity packed into Any.
Link copied to clipboard
Obtains recent history of events of this entity.
Link copied to clipboard
Adds events to the recent history.
Link copied to clipboard
Sets archived} status flag to the passed value.
Link copied to clipboard
Sets deleted} status flag to the passed value.
Link copied to clipboard
Sets an initial state for the entity.
Link copied to clipboard
Creates
ValueMismatch
for the case of discovering a value different than by a command.Creates
ValueMismatch
for the case of discovering a value different than expected by a command.Link copied to clipboard
Obtains the version number of the entity.
Link copied to clipboard
Obtains timestamp of the entity version.