package org.springblade.flow.engine.custom.idgen;

import org.flowable.common.engine.impl.cfg.IdGenerator;
import org.springblade.flow.base.util.IdWorker;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @Author:LoveMyOrange
 * @Description: 自定义Activiti主键生成器 防止 并发下 主键重复   性能问题
 * @Date:Created in 2021/12/17 13:45
 */
@Component
public class ActivitiIDWorker implements IdGenerator {
    @Resource
    private IdWorker idWorker;
    @Override
    public String getNextId() {
        return String.valueOf(idWorker.nextId());
    }
}
