package com.ho.flow.config;

import lombok.extern.slf4j.Slf4j;
import org.activiti.engine.impl.cfg.IdGenerator;
import org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @author fancl
 * @desc: id生成
 * @date 2023/1/2
 */
//@Component
@Slf4j
public class FlowIdGenerator implements IdGenerator {

    @Autowired
    ProcessEngineConfigurationImpl processEngineConfigurationImpl;

    @Override
    public String getNextId() {
        String nextId = processEngineConfigurationImpl.getDbSqlSessionFactory().getIdGenerator().getNextId();
        log.info("Flow nextId:" + nextId);
        return nextId;
    }
}
