I am trying to find a way to perform actions before the guards are evaluated like want to add API response into the extended state object which is triggered for a specific State and event and based on that response want to evaluate the guards. But I am unable to find any listener or interceptor that serves the purpose.
I am new to spring boot state machine. Can somebody please help?
@Override
public void configure( StateMachineTransitionConfigurer<RedactionStates,
RedactionEvents> transitions) throws Exception
{
transitions
.withExternal()
.source(RedactionStates.R1).target(RedactionStates.R2)
.event(RedactionEvents.E1)
.action(c -> { // Make the API Call // Store in the extended state }) .guard(new G1(COMPLETED))
.and()
.withExternal() .source(RedactionStates.R1) .target(RedactionStates.R3)
.event(RedactionEvents.E1)
.guard(new G2(SKIPPED))
.and()
.withExternal() .source(RedactionStates.R1) .target(RedactionStates.R4)
.guard(new G3(IN_PROGRESS));
}