mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-23 23:45:08 +08:00
BPM 模型重构 2:导入流程时,只填写 name、description、key
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user