BPM:重构审批人的分配规则实现,移除 bpm_task_assign_rule 表,存储在 bpmn 的 userTask 中

This commit is contained in:
YunaiV
2024-03-13 21:18:07 +08:00
parent dda0909843
commit cdbcd4d673
19 changed files with 110 additions and 624 deletions

View File

@ -1,9 +1,11 @@
package cn.iocoder.yudao.framework.flowable.core.util;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ArrayUtil;
import org.flowable.bpmn.converter.BpmnXMLConverter;
import org.flowable.bpmn.model.Process;
import org.flowable.bpmn.model.*;
import org.flowable.common.engine.impl.util.io.BytesStreamSource;
import java.util.*;
@ -91,6 +93,15 @@ public class BpmnModelUtils {
return converter.convertToXML(model);
}
public static BpmnModel getBpmnModel(byte[] bpmnBytes) {
if (ArrayUtil.isEmpty(bpmnBytes)) {
return null;
}
BpmnXMLConverter converter = new BpmnXMLConverter();
// 补充说明:由于在 Flowable 中自定义了属性,所以 validateSchema 传递 false
return converter.convertToBpmnModel(new BytesStreamSource(bpmnBytes), false, false);
}
// ========== 遍历相关的方法 ==========
/**