I have a flow that looks like
Source(A).Target(B).Event(AB) // event triggered transition
Source(B).Target(C) // anonymous transition
Source(C).Target(D) // anonymous transition
I have an Interceptor class that looks like
public class StateMachineEventInterceptor extends StateMachineInterceptorAdapter < States, Events > {
public StateMachineEventInterceptor() {}
@Override
public void postStateChange(State < States, Events > state, Message < Events > message, Transition < States, Events > transition,
StateMachine < States, Events > stateMachine, StateMachine < States, Events > rootStateMachine) {
executorService.submit(() - > {
if (message != null) { // persist state, event in an audit table }
)
}
}
}
However, it seems like Message will always contain the last event sent to the statemachine, which in this case
is event AB. Is there any way I can know whether the transition was anonymous so that I can persist a null in the event column of my audit table?
I have a flow that looks like
I have an Interceptor class that looks like
However, it seems like
Messagewill always contain the last event sent to the statemachine, which in this caseis event
AB. Is there any way I can know whether the transition was anonymous so that I can persist a null in the event column of my audit table?