GoldSubmarine / workflow-bpmn-modeler

🔥 flowable workflow designer based on vue and bpmn.io@7.0
https://goldsubmarine.github.io/workflow-bpmn-modeler/demo/
MIT License
1.22k stars 339 forks source link

CDATA中的小于号无法被解析 #27

Closed yugonglan closed 3 years ago

yugonglan commented 3 years ago

bpmn文件有条件表达式不能识别 导入文件含有" <![CDATA[${amount>500}]]>"出现 index.vue?6ced:159 unparsable content <=500}]]> detected; this may indicate an invalid BPMN 2.0 diagram file line: 44 column: 78 nested error: illegal first char nodeName Array(6) _callee$ @ index.vue?6ced:159

yugonglan commented 3 years ago

导入含有<conditionExpression xsi:type="tFormalExpression"><![CDATA[${amount>500}]]></conditionExpression>出现index.vue?6ced:159 unparsable content <=500}]]&gt;</conditionExpression> detected; this may indicate an invalid BPMN 2.0 diagram file line: 44 column: 78 nested error: illegal first char nodeName Array(6) _callee$ @ index.vue?6ced:159

GoldSubmarine commented 3 years ago

可否提供完整的 xml 文件

yugonglan commented 3 years ago

`<?xml version="1.0" encoding="UTF-8"?>

为合同审批而设计 500}]]> `
GoldSubmarine commented 3 years ago

CDATA - (未解析)字符数据

"<" 和 "&" 字符在 XML 元素中都是非法的,就像我们使用 mybatis 写 sql 的时候也没法用小于号,但是用 CDATA 包裹起来的文本是可以出现小于号的,所以你的 xml 写法是对的,这个地方感觉是 bpmn 的坑。

所以我准备弃用 CDATA ,直接使用转义字符,自动将 <> 转换成 &#60;&#62;

yugonglan commented 3 years ago

@GoldSubmarine 你说的是有道理,但是也要考虑实际情况,不管是activiti还是flowable,都是用CDATA,新的方向是没错,但是也要考虑之前的导出文件能适配

GoldSubmarine commented 3 years ago

兼容一下就可以了