Aggregate inner state and event order

Is it ok when a command issues several events

changeA(a){
if (this.a !=f(a)) apply(new A(a))
apply(new B(f(this.a)))
}

handle(A){
this.a=A.a
}

means I rely on the fact that the events are applied in sequence.
this seems to be valid within the aggregate, but might depend on the eventbus infrastructure

good or bad? alternatives?
ro

Hi Roland,

it's a perfectly normal case. I come across use cases for this very often.

In fact, Axon will invoke the event handler method immediately, as part of the apply() call. Publication of the event to the other event handlers only occurs when the UnitOfWork is committed (which happens when the command is successfully executed).

Cheers,

Allard