|
@@ -1,5 +1,6 @@
|
|
package cn.iocoder.yudao.module.bpm.service.definition;
|
|
package cn.iocoder.yudao.module.bpm.service.definition;
|
|
|
|
|
|
|
|
+import cn.hutool.core.util.ArrayUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
|
|
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
|
|
@@ -103,7 +104,7 @@ public class BpmModelServiceImpl implements BpmModelService {
|
|
// 保存流程定义
|
|
// 保存流程定义
|
|
repositoryService.saveModel(model);
|
|
repositoryService.saveModel(model);
|
|
// 保存 BPMN XML
|
|
// 保存 BPMN XML
|
|
- saveModelBpmnXml(model, bpmnXml);
|
|
|
|
|
|
+ saveModelBpmnXml(model.getId(), StrUtil.utf8Bytes(bpmnXml));
|
|
return model.getId();
|
|
return model.getId();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -121,7 +122,7 @@ public class BpmModelServiceImpl implements BpmModelService {
|
|
// 更新模型
|
|
// 更新模型
|
|
repositoryService.saveModel(model);
|
|
repositoryService.saveModel(model);
|
|
// 更新 BPMN XML
|
|
// 更新 BPMN XML
|
|
- saveModelBpmnXml(model, updateReqVO.getBpmnXml());
|
|
|
|
|
|
+ saveModelBpmnXml(model.getId(), StrUtil.utf8Bytes(updateReqVO.getBpmnXml()));
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -236,11 +237,25 @@ public class BpmModelServiceImpl implements BpmModelService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- private void saveModelBpmnXml(Model model, String bpmnXml) {
|
|
|
|
- if (StrUtil.isEmpty(bpmnXml)) {
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public void saveModelBpmnXml(String id, byte[] xmlBytes) {
|
|
|
|
+ if (ArrayUtil.isEmpty(xmlBytes)) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ repositoryService.addModelEditorSource(id, xmlBytes);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public byte[] getModelSimpleJson(String id) {
|
|
|
|
+ return repositoryService.getModelEditorSourceExtra(id);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void saveModelSimpleJson(String id, byte[] jsonBytes) {
|
|
|
|
+ if (ArrayUtil.isEmpty(jsonBytes)) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- repositoryService.addModelEditorSource(model.getId(), StrUtil.utf8Bytes(bpmnXml));
|
|
|
|
|
|
+ repositoryService.addModelEditorSourceExtra(id, jsonBytes);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|