List of usage examples for org.springframework.statemachine.config.configurers StateConfigurer state
StateConfigurer<S, E> state(S state, Action<S, E> entryAction, Action<S, E> exitAction);
From source file:com.netflix.genie.agent.execution.statemachine.StateMachineAutoConfiguration.java
private void configureStates(final StateMachineBuilder.Builder<States, Events> builder, final Collection<Pair<States, StateAction>> statesWithActions) throws Exception { // Set up initial and terminal states (action-free) final StateConfigurer<States, Events> stateConfigurer = builder.configureStates().withStates() .initial(States.READY).end(States.END); // Set up the rest of the states with their corresponding action for (Pair<States, StateAction> stateWithAction : statesWithActions) { final States state = stateWithAction.getLeft(); final StateAction action = stateWithAction.getRight(); stateConfigurer // Use entryAction because it is not interruptible. // StateAction is susceptible to cancellation in case of event-triggered transition out of the state. .state(state, action, null); log.info("Configured state {} with action {}", state, action.getClass().getSimpleName()); }//from ww w . j a v a 2 s. c o m }