diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/definition/impl/BpmModelServiceImpl.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/definition/impl/BpmModelServiceImpl.java index 10c79d33e..32a82461b 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/definition/impl/BpmModelServiceImpl.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/definition/impl/BpmModelServiceImpl.java @@ -31,6 +31,7 @@ import org.springframework.util.ObjectUtils; import org.springframework.validation.annotation.Validated; import javax.annotation.Resource; +import java.nio.charset.StandardCharsets; import java.util.HashSet; import java.util.List; import java.util.Map; @@ -148,9 +149,7 @@ public class BpmModelServiceImpl implements BpmModelService { if (StrUtil.isEmpty(bpmnXml)) { return; } - byte[] bpmnBytes = ActivitiUtils.replaceBpmnMainProcessIdAndName(bpmnXml, - model.getKey(), model.getName()); - repositoryService.addModelEditorSource(model.getId(), bpmnBytes); + repositoryService.addModelEditorSource(model.getId(), bpmnXml.getBytes(StandardCharsets.UTF_8)); } @Override diff --git a/yudao-admin-ui/src/views/bpm/model/index.vue b/yudao-admin-ui/src/views/bpm/model/index.vue index 9841f121e..c9f0c444c 100644 --- a/yudao-admin-ui/src/views/bpm/model/index.vue +++ b/yudao-admin-ui/src/views/bpm/model/index.vue @@ -404,7 +404,7 @@ export default { // 重置表单 this.uploadClose(); // 提示,并刷新 - this.msgSuccess("导入流程模型成功"); + this.msgSuccess("导入流程模型成功!请点击【设计流程】按钮,进行编辑保存后,才可以进行【发布流程】"); this.getList(); }, uploadClose() { diff --git a/yudao-framework/yudao-spring-boot-starter-activiti/src/main/java/cn/iocoder/yudao/framework/activiti/core/util/ActivitiUtils.java b/yudao-framework/yudao-spring-boot-starter-activiti/src/main/java/cn/iocoder/yudao/framework/activiti/core/util/ActivitiUtils.java index aff555fad..df229a8ba 100644 --- a/yudao-framework/yudao-spring-boot-starter-activiti/src/main/java/cn/iocoder/yudao/framework/activiti/core/util/ActivitiUtils.java +++ b/yudao-framework/yudao-spring-boot-starter-activiti/src/main/java/cn/iocoder/yudao/framework/activiti/core/util/ActivitiUtils.java @@ -42,23 +42,4 @@ public class ActivitiUtils { // ========== BPMN XML 相关 ========== - /** - * 替换 BPMN XML 主流程的 id 和 name 属性 - * - * @param bpmnXml 原始的 BPMN XML 字符串 - * @param id 编号,对应到 XML 实际是 key 属性 - * @param name 名字 - * @return 新的 BPMN XML 的字节数组 - */ - public static byte[] replaceBpmnMainProcessIdAndName(String bpmnXml, String id, String name) { - // 转换成 BpmnModel 对象 - BpmnXMLConverter converter = new BpmnXMLConverter(); - BpmnModel bpmnModel = converter.convertToBpmnModel(new StringStreamSource(bpmnXml), true, true); - // 设置 id 和 name 属性 - bpmnModel.getMainProcess().setId(id); - bpmnModel.getMainProcess().setName(name); - // 转换回字节数组 - return converter.convertToXML(bpmnModel); - } - }