in dynamic-router-eip/dynamic-router-eip-stack/main-router/src/main/java/org/apache/camel/example/springboot/numbers/mainrouter/config/StateMachineConfig.java [58:88]
public void configure(StateMachineTransitionConfigurer<States, Events> transitions) throws Exception {
// @formatter:off
transitions
.withExternal()
.source(States.STARTING)
.target(States.INITIALIZING)
.event(Events.PARTICIPANT_SUBSCRIBED)
.guard(context -> !initialized)
.action(context -> initialized = true)
.action(resetStatisticsAction)
.action(warmUpAction)
.and()
.withExternal()
.source(States.INITIALIZING)
.target(States.READY)
.event(Events.INITIALIZATION_COMPLETE)
.action(resetStatisticsAction)
.and()
.withExternal()
.source(States.READY)
.target(States.GENERATING_NUMBERS)
.event(Events.GENERATE_NUMBERS_STARTED)
.action(resetStatisticsAction)
.action(generateNumbersAction)
.and()
.withExternal()
.source(States.GENERATING_NUMBERS)
.target(States.READY)
.event(Events.GENERATE_NUMBERS_COMPLETE);
// @formatter:on
}