package click.kamil.enterprise.core;

import org.springframework.statemachine.config.EnumStateMachineConfigurerAdapter;
import org.springframework.statemachine.config.builders.StateMachineStateConfigurer;
import org.springframework.statemachine.config.builders.StateMachineTransitionConfigurer;

public abstract class AbstractStateMachineConfiguration<S extends Enum<S> & EnterpriseState, E extends Enum<E> & EnterpriseEvent> extends EnumStateMachineConfigurerAdapter<S, E> {
    
    @Override
    public void configure(StateMachineStateConfigurer<S, E> states) throws Exception {
        configureStates(states);
    }
    
    @Override
    public void configure(StateMachineTransitionConfigurer<S, E> transitions) throws Exception {
        configureTransitions(transitions);
    }
    
    protected abstract void configureStates(StateMachineStateConfigurer<S, E> states) throws Exception;
    protected abstract void configureTransitions(StateMachineTransitionConfigurer<S, E> transitions) throws Exception;
    
    protected void commonProtectedMethod() {
        System.out.println("Common protected method called in AbstractStateMachineConfiguration.");
    }
}
