mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-20 02:08:15 +08:00
update 优化 工作流id生成器保持全局统一
This commit is contained in:
parent
acbef6e170
commit
305f9ea139
@ -1,6 +1,8 @@
|
||||
package org.dromara.workflow.flowable.config;
|
||||
|
||||
import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;
|
||||
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
|
||||
import org.flowable.common.engine.impl.cfg.IdGenerator;
|
||||
import org.flowable.spring.SpringProcessEngineConfiguration;
|
||||
import org.flowable.spring.boot.EngineConfigurationConfigurer;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -19,10 +21,12 @@ public class FlowableConfig implements EngineConfigurationConfigurer<SpringProce
|
||||
|
||||
@Autowired
|
||||
private GlobalFlowableListener globalFlowableListener;
|
||||
@Autowired
|
||||
private IdentifierGenerator identifierGenerator;
|
||||
|
||||
@Override
|
||||
public void configure(SpringProcessEngineConfiguration processEngineConfiguration) {
|
||||
processEngineConfiguration.setIdGenerator(IdWorker::getIdStr);
|
||||
processEngineConfiguration.setIdGenerator(() -> identifierGenerator.nextId(null).toString());
|
||||
processEngineConfiguration.setEventListeners(Collections.singletonList(globalFlowableListener));
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user