CRITICAL:bpmn-js Modeler.saveXML 把被 activiti.json `extends` 的 bpmn 类型序列化成
PascalCase 元素名(<Process>/<UserTask>/<StartEvent>…),未扩展的 <sequenceFlow>/<endEvent>
仍小写。Flowable 大小写敏感 → <Process> 不被识别为流程,ProcessValidator 报
flowable-process-definition-not-executable,部署完全失败。
根因:moddle 把「被扩展类型」的合并描述符 $pkg 设为**最后一个 trait 的包**(moddle
index.esm.js:577)。activiti 包缺 `xml.tagAlias:"lowerCase"`,故 moddle-xml 写元素名时不做
首字母小写 → PascalCase。且 tagAlias 是**双向**的(也驱动 fromXML 解析),要求自定义元素类型名
用 activiti/camunda 惯例的 PascalCase,否则解析 <activiti:taskListener> 找不到类型而丢弃。
修法(对齐 activiti/camunda-bpmn-moddle 标准):
- activiti.json + flowable.json 加 `"xml": { "tagAlias": "lowerCase" }`;
- 自定义元素类型名改 PascalCase:taskListener→TaskListener / executionListener→ExecutionListener
/ field→Field / formProperty→FormProperty / value→Value / in→In / out→Out(属性 type 引用同步)。
XML 元素名仍小写(tagAlias),故 fixture 与「toContain('activiti:taskListener')」类 XML 断言不变。
- Eip4Panel.tsx:moddle.create/$type 用 'activiti:TaskListener';测试 fake 类型名同步。
为何旧测试没抓到:T1.1/T1.2 只断言 activiti 扩展属性/元素多重集,从不断言基础 BPMN 元素名大小写;
fromXML→toXML 与 create 都走同一 moddle-xml Writer 且都产 PascalCase(本 commit 实证)。
新增 serialization.test.ts(4 例,RED→GREEN):以 BpmnModdle(= Modeler.saveXML 的 moddle 层,
jsdom 跑不动 diagram-js SVG)驱动 fromXML→toXML 与 create→toXML,断言基础元素名全小写、无 PascalCase、
isExecutable 保留、扩展元素/属性不丢;flowable 隔离同验。
serialization 4 + fidelity 12 + Eip4Panel 37;全量 231 单测绿,tsc -b rc=0 + build 干净。
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
179 lines
6.5 KiB
JSON
179 lines
6.5 KiB
JSON
{
|
|
"name": "Activiti",
|
|
"uri": "http://activiti.org/bpmn",
|
|
"prefix": "activiti",
|
|
"xml": { "tagAlias": "lowerCase" },
|
|
"associations": [],
|
|
"types": [
|
|
{
|
|
"name": "ActivityExtension",
|
|
"isAbstract": true,
|
|
"extends": ["bpmn:Activity"],
|
|
"properties": [
|
|
{ "name": "exclusive", "isAttr": true, "type": "String" },
|
|
{ "name": "async", "isAttr": true, "type": "String" },
|
|
{ "name": "asyncBefore", "isAttr": true, "type": "String" },
|
|
{ "name": "asyncAfter", "isAttr": true, "type": "String" }
|
|
]
|
|
},
|
|
{
|
|
"name": "UserTaskExtension",
|
|
"isAbstract": true,
|
|
"extends": ["bpmn:UserTask"],
|
|
"properties": [
|
|
{ "name": "assignee", "isAttr": true, "type": "String" },
|
|
{ "name": "candidateUsers", "isAttr": true, "type": "String" },
|
|
{ "name": "candidateGroups", "isAttr": true, "type": "String" },
|
|
{ "name": "formKey", "isAttr": true, "type": "String" },
|
|
{ "name": "dueDate", "isAttr": true, "type": "String" },
|
|
{ "name": "priority", "isAttr": true, "type": "String" },
|
|
{ "name": "category", "isAttr": true, "type": "String" },
|
|
{ "name": "skipExpression", "isAttr": true, "type": "String" }
|
|
]
|
|
},
|
|
{
|
|
"name": "StartEventExtension",
|
|
"isAbstract": true,
|
|
"extends": ["bpmn:StartEvent"],
|
|
"properties": [
|
|
{ "name": "formKey", "isAttr": true, "type": "String" },
|
|
{ "name": "initiator", "isAttr": true, "type": "String" }
|
|
]
|
|
},
|
|
{
|
|
"name": "ProcessExtension",
|
|
"isAbstract": true,
|
|
"extends": ["bpmn:Process"],
|
|
"properties": [
|
|
{ "name": "candidateStarterUsers", "isAttr": true, "type": "String" },
|
|
{ "name": "candidateStarterGroups", "isAttr": true, "type": "String" },
|
|
{ "name": "versionTag", "isAttr": true, "type": "String" },
|
|
{ "name": "historyTimeToLive", "isAttr": true, "type": "String" }
|
|
]
|
|
},
|
|
{
|
|
"name": "ScriptTaskExtension",
|
|
"isAbstract": true,
|
|
"extends": ["bpmn:ScriptTask"],
|
|
"properties": [
|
|
{ "name": "autoStoreVariables", "isAttr": true, "type": "String" },
|
|
{ "name": "resultVariable", "isAttr": true, "type": "String" }
|
|
]
|
|
},
|
|
{
|
|
"name": "ServiceTaskExtension",
|
|
"isAbstract": true,
|
|
"extends": ["bpmn:ServiceTask", "bpmn:SendTask", "bpmn:BusinessRuleTask"],
|
|
"properties": [
|
|
{ "name": "class", "isAttr": true, "type": "String" },
|
|
{ "name": "expression", "isAttr": true, "type": "String" },
|
|
{ "name": "delegateExpression", "isAttr": true, "type": "String" },
|
|
{ "name": "resultVariableName", "isAttr": true, "type": "String" },
|
|
{ "name": "type", "isAttr": true, "type": "String" }
|
|
]
|
|
},
|
|
{
|
|
"name": "CallActivityExtension",
|
|
"isAbstract": true,
|
|
"extends": ["bpmn:CallActivity"],
|
|
"properties": [
|
|
{ "name": "calledElementBinding", "isAttr": true, "type": "String" },
|
|
{ "name": "calledElementVersion", "isAttr": true, "type": "String" }
|
|
]
|
|
},
|
|
{
|
|
"name": "MultiInstanceExtension",
|
|
"isAbstract": true,
|
|
"extends": ["bpmn:MultiInstanceLoopCharacteristics"],
|
|
"properties": [
|
|
{ "name": "collection", "isAttr": true, "type": "String" },
|
|
{ "name": "elementVariable", "isAttr": true, "type": "String" }
|
|
]
|
|
},
|
|
{
|
|
"name": "TaskListener",
|
|
"superClass": ["Element"],
|
|
"meta": { "allowedIn": ["bpmn:UserTask"] },
|
|
"properties": [
|
|
{ "name": "event", "isAttr": true, "type": "String" },
|
|
{ "name": "class", "isAttr": true, "type": "String" },
|
|
{ "name": "expression", "isAttr": true, "type": "String" },
|
|
{ "name": "delegateExpression", "isAttr": true, "type": "String" },
|
|
{ "name": "fields", "type": "Field", "isMany": true }
|
|
]
|
|
},
|
|
{
|
|
"name": "ExecutionListener",
|
|
"superClass": ["Element"],
|
|
"meta": { "allowedIn": ["*"] },
|
|
"properties": [
|
|
{ "name": "event", "isAttr": true, "type": "String" },
|
|
{ "name": "class", "isAttr": true, "type": "String" },
|
|
{ "name": "expression", "isAttr": true, "type": "String" },
|
|
{ "name": "delegateExpression", "isAttr": true, "type": "String" },
|
|
{ "name": "fields", "type": "Field", "isMany": true }
|
|
]
|
|
},
|
|
{
|
|
"name": "Field",
|
|
"superClass": ["Element"],
|
|
"meta": { "allowedIn": ["*"] },
|
|
"properties": [
|
|
{ "name": "name", "isAttr": true, "type": "String" },
|
|
{ "name": "stringValue", "isAttr": true, "type": "String" },
|
|
{ "name": "string", "type": "String" },
|
|
{ "name": "expression", "type": "String" }
|
|
]
|
|
},
|
|
{
|
|
"name": "FormProperty",
|
|
"superClass": ["Element"],
|
|
"meta": { "allowedIn": ["*"] },
|
|
"properties": [
|
|
{ "name": "id", "isAttr": true, "type": "String" },
|
|
{ "name": "name", "isAttr": true, "type": "String" },
|
|
{ "name": "type", "isAttr": true, "type": "String" },
|
|
{ "name": "required", "isAttr": true, "type": "String" },
|
|
{ "name": "readable", "isAttr": true, "type": "String" },
|
|
{ "name": "writable", "isAttr": true, "type": "String" },
|
|
{ "name": "variable", "isAttr": true, "type": "String" },
|
|
{ "name": "expression", "isAttr": true, "type": "String" },
|
|
{ "name": "datePattern", "isAttr": true, "type": "String" },
|
|
{ "name": "default", "isAttr": true, "type": "String" },
|
|
{ "name": "value", "isAttr": true, "type": "String" },
|
|
{ "name": "values", "type": "Value", "isMany": true }
|
|
]
|
|
},
|
|
{
|
|
"name": "Value",
|
|
"superClass": ["Element"],
|
|
"properties": [
|
|
{ "name": "id", "isAttr": true, "type": "String" },
|
|
{ "name": "name", "isAttr": true, "type": "String" }
|
|
]
|
|
},
|
|
{
|
|
"name": "In",
|
|
"superClass": ["Element"],
|
|
"meta": { "allowedIn": ["*"] },
|
|
"properties": [
|
|
{ "name": "source", "isAttr": true, "type": "String" },
|
|
{ "name": "sourceExpression", "isAttr": true, "type": "String" },
|
|
{ "name": "target", "isAttr": true, "type": "String" },
|
|
{ "name": "variables", "isAttr": true, "type": "String" }
|
|
]
|
|
},
|
|
{
|
|
"name": "Out",
|
|
"superClass": ["Element"],
|
|
"meta": { "allowedIn": ["*"] },
|
|
"properties": [
|
|
{ "name": "source", "isAttr": true, "type": "String" },
|
|
{ "name": "sourceExpression", "isAttr": true, "type": "String" },
|
|
{ "name": "target", "isAttr": true, "type": "String" },
|
|
{ "name": "variables", "isAttr": true, "type": "String" }
|
|
]
|
|
}
|
|
]
|
|
}
|