反序列化问题。
This commit is contained in:
parent
4f58a92167
commit
2878d66e50
@ -166,7 +166,7 @@ public class BpmnConverter {
|
||||
if (element instanceof ServiceTask) {
|
||||
configureServiceTask((ServiceTask) element, node, process, extensionElements);
|
||||
} else if (element instanceof StartEvent || element instanceof EndEvent) {
|
||||
// 为开始节点和结束节点设置监<EFBFBD><EFBFBD>器
|
||||
// 为开始节点和结束节点设置监听器
|
||||
element.setExtensionElements(extensionElements);
|
||||
}
|
||||
}
|
||||
@ -246,9 +246,8 @@ public class BpmnConverter {
|
||||
stringElement.setName("string");
|
||||
stringElement.setNamespace("http://flowable.org/bpmn");
|
||||
stringElement.setNamespacePrefix("flowable");
|
||||
// 转义JSON内容
|
||||
String escapedJson = escapeXml(node.getPanelVariables().toString());
|
||||
stringElement.setElementText(escapedJson);
|
||||
// 直接设置JSON内容,不使用CDATA
|
||||
stringElement.setElementText(node.getPanelVariables().toString());
|
||||
|
||||
// 设置field的name属性
|
||||
Map<String, List<ExtensionAttribute>> fieldAttributes = new HashMap<>();
|
||||
@ -274,9 +273,8 @@ public class BpmnConverter {
|
||||
stringElement.setName("string");
|
||||
stringElement.setNamespace("http://flowable.org/bpmn");
|
||||
stringElement.setNamespacePrefix("flowable");
|
||||
// 转义JSON内容
|
||||
String escapedJson = escapeXml(node.getLocalVariables().toString());
|
||||
stringElement.setElementText(escapedJson);
|
||||
// 直接设置JSON内容,不使用CDATA
|
||||
stringElement.setElementText(node.getLocalVariables().toString());
|
||||
|
||||
// 设置field的name属性
|
||||
Map<String, List<ExtensionAttribute>> fieldAttributes = new HashMap<>();
|
||||
@ -309,7 +307,7 @@ public class BpmnConverter {
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建执行监听器扩展<EFBFBD><EFBFBD>素
|
||||
* 创建执行监听器扩展元素
|
||||
*
|
||||
* @param event 事件类型(start/end)
|
||||
* @param delegateExpression 委托表达式
|
||||
@ -352,7 +350,6 @@ public class BpmnConverter {
|
||||
EndEvent errorEndEvent = createErrorEndEvent(serviceTask);
|
||||
SequenceFlow errorFlow = createErrorSequenceFlow(boundaryEvent, errorEndEvent);
|
||||
|
||||
// 将错误处理相关的元素添加到流程中
|
||||
process.addFlowElement(boundaryEvent);
|
||||
process.addFlowElement(errorEndEvent);
|
||||
process.addFlowElement(errorFlow);
|
||||
@ -419,7 +416,7 @@ public class BpmnConverter {
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换连<EFBFBD><EFBFBD>为顺序流
|
||||
* 转换连线为顺序流
|
||||
*
|
||||
* @param edges 工作流定义边集合
|
||||
* @param idMapping 节点ID映射
|
||||
@ -437,21 +434,4 @@ public class BpmnConverter {
|
||||
process.addFlowElement(flow);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 转义XML特殊字符
|
||||
*
|
||||
* @param input 需要转义的字符串
|
||||
* @return 转义后的字符串
|
||||
*/
|
||||
private String escapeXml(String input) {
|
||||
if (input == null) {
|
||||
return null;
|
||||
}
|
||||
return input.replace("&", "&")
|
||||
.replace("<", "<")
|
||||
.replace(">", ">")
|
||||
.replace("\"", """)
|
||||
.replace("'", "'");
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user