I’m handling events with newEventHandlerBuilder(), and notice that if I return “null” for a state, the event will be handled by multiple handlers, for example, with this code
eventEventHandlerBuilder
.forAnyState()
.onEvent(MemberDeleted.class, memberDeleted → {
logger.info(String.format(“forAnyState, onEvent: %s”, memberDeleted));
return null;
})
.onAnyEvent(event → {
logger.warning(String.format(“forAnyState, onAnyEvent: %s”, event));
return null;
});
I will see both the onEvent and onAnyEvent being called for a MemberDeleted event. But if i change the return type to a class (I added a NullMember class) I will only see the onEvent method called.
It’s not supported to return a null, if there is no real state to care about?
thanks in advance