<dependency> <groupId>org.springframework.statemachine</groupId>
<artifactId>spring-statemachine-core</artifactId>
<version>2.3.0.RELEASE</version>
</dependency>
public enum States {
INITIAL, STATE1, STATE2, FINAL
}
public enum Events {
EVENT1, EVENT2
}
@Configuration
@EnableStateMachine
public class StateMachineConfig extends EnumStateMachineConfigurerAdapter<States, Events> {
@Override
public void configure(StateMachineStateConfigurer<States, Events> states) throws Exception {
states
.withStates()
.initial(States.INITIAL)
.states(EnumSet.allOf(States.class));
}
@Override
public void configure(StateMachi