package com.ningdatech.pmapi.common.statemachine.builder;

import com.ningdatech.pmapi.common.statemachine.event.ProjectStatusChangeEvent;
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.statemachine.StateMachine;
import org.springframework.statemachine.persist.StateMachinePersister;

/**
 * 项目申报状态机
 *
 * @author CMM
 * @since 2023/02/07 15:56
 */
public interface ProjectDeclareStateMachineBuilder {
    StateMachine<ProjectStatusEnum, ProjectStatusChangeEvent> build() throws Exception;
    /**
     * 构建状态机
     * @param beanFactory
     * @author CMM
     * @since 2023/02/07 16:15
     */
    StateMachine<ProjectStatusEnum, ProjectStatusChangeEvent> build(BeanFactory beanFactory) throws Exception;

    /**
     * 持久化配置
     * @author CMM
     * @since 2023/02/07 16:22
     */
    StateMachinePersister<ProjectStatusEnum, ProjectStatusChangeEvent, Project> getProjectPersister();
}
