package click.kamil.maven.base;

import org.springframework.statemachine.StateContext;
import org.springframework.statemachine.action.Action;
import org.springframework.statemachine.config.StateMachineConfigurerAdapter;
import org.springframework.statemachine.config.builders.StateMachineStateConfigurer;

public abstract class AbstractMavenStateMachine extends StateMachineConfigurerAdapter<String, String> {

    @Override
    public void configure(StateMachineStateConfigurer<String, String> states) throws Exception {
        states
            .withStates()
            .initial("INIT")
            .state("BUSY")
            .end("DONE");
    }

    protected Action<String, String> loggingAction() {
        return context -> {
            System.out.println("LOG: State transition in progress...");
        };
    }
}
