feat(modeler): activiti/flowable moddle 描述符 + 语料覆盖/round-trip 保真测试

在线流程 Modeler 阶段1 Task 1.1(P1 双门验收)。为 bpmn-js Modeler 载入
存量 activiti BPMN 提供 vendored moddle 描述符,并以合成 fixture 验证零丢失。

依赖(与 bpmn-js 17.11.1 兼容,实际解析版本):
- bpmn-js-properties-panel 5.60.0(package.json ^5.23.0)
- @bpmn-io/properties-panel 3.47.0(package.json ^3.23.0)
- bpmn-moddle 8.1.0(bpmn-js 传递依赖,直接 import)

交付:
- src/modeler/moddle/activiti.json:完整 activiti 命名空间描述符,覆盖 §0 实测
  全集——属性 formKey/candidateUsers/exclusive/assignee/collection/elementVariable/
  candidateGroups/autoStoreVariables/initiator/dueDate(按宿主 extends 到 UserTask/
  StartEvent/Process/ScriptTask/MultiInstanceLoopCharacteristics 等)+ 元素
  taskListener/formProperty/field/string/value/executionListener/in/out。
- src/modeler/moddle/flowable.json:flowable 命名空间镜像描述符(覆盖 flowable:assignee 等)。
- src/modeler/moddle/fixtures/synthetic-full-surface.bpmn.ts:合成 fixture,形态逐字
  对照真实流程「总包合同交底」——含全角【】办理人 JSON、多实例、taskListener+field/
  string、formProperty+value、boundaryEvent+timer、conditionExpression、完整 DI。
- src/modeler/moddle/fidelity.test.ts:12 用例(语料覆盖 + round-trip 零丢失)。

fixture 关键形态发现(实证):
- 办理人/会签 JSON 用**全角【】**包裹对象,方括号 [] 半角,引号在属性内以 " 转义;
  content 尾部有 CHAR 补白空格(如 "4028...0f7d    ")——均需零丢失。
- candidateUsers 表达式解析后 byte-exact 等于原文;moddle 序列化把 '/" 输出为
  数字实体 '/",全角【】原样保留(XML 语义等价、模型层零丢失)。

勘探实证并固化为回归测试的两条 moddle 约束:
- moddle-xml 拒绝中文 id(illegal ID,须 NCName ASCII)→ 这正是 D7 BpmnIdSanitizer
  在进 moddle 前净化、发布时还原的根本原因;fixture 用 ASCII id、中文仅留在 name。
- activiti+flowable 双包同载会因跨包同名 extends 属性(如 exclusive)冲突而丢弃 userTask
  → 按命名空间隔离加载;已验证 Modeler 单载 activiti 时 flowable 属性经 lax $attrs 零丢失
  往返(Task 1.5 Modeler 应单载 activiti)。

验证:npx vitest run src/modeler 12/12 绿;全量 101/101 绿;tsc -b 干净;npm run build 成功。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-02 09:35:23 +08:00
parent a807078595
commit 8fdfe688f8
6 changed files with 1203 additions and 0 deletions

View File

@@ -0,0 +1,176 @@
{
"name": "Activiti",
"uri": "http://activiti.org/bpmn",
"prefix": "activiti",
"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": "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" }
]
}
]
}

View File

@@ -0,0 +1,206 @@
import { describe, it, expect } from 'vitest';
import BpmnModdle from 'bpmn-moddle';
import activiti from './activiti.json';
import flowable from './flowable.json';
import { SYNTHETIC_BPMN } from './fixtures/synthetic-full-surface.bpmn';
// §0 实测扩展面(本地 eip4 库 5433):11 属性 + 5 元素 + 命名空间 activiti/flowable。
const CORPUS_ATTRS = [
'formKey', 'candidateUsers', 'exclusive', 'assignee', 'collection',
'elementVariable', 'candidateGroups', 'autoStoreVariables', 'initiator', 'dueDate',
];
const CORPUS_ELEMENTS = ['taskListener', 'formProperty', 'value', 'field', 'string'];
// 接收交底 userTask 的 candidateUsers 表达式反转义后的真实态:真引号 + 全角【】+ content 尾 4 空格。
const EXPECTED_CANDIDATE_USERS =
`\${candidateUsersHandler.getCandidateUsers(execution,'【"items":[【"type":"position",` +
`"content":"402881343cd50391013d62ccd0c20f7d ","isCandidate":true,"isSendMail":false,` +
`"isSendPhone":false,"isSendMessage":false】],"messageTemplate":"",` +
`"taskSuccessService":"PM_CONTRACTUALREGISTER_UPDATEPROJECTSTATUS",` +
`"isSkipInitiator":false,"isNoUserSkip":false,"isSkipBeforeTask":true】')}`;
// moddle 跨包同名 extends 属性冲突(activiti:exclusive vs flowable:exclusive 均挂 bpmn:Activity),
// 两包同载会丢元素。真实语料每文档只用一个命名空间(1509 activiti / 3 flowable,不混用),
// 故按命名空间隔离加载。见文末「moddle 约束」测试。
const newActiviti = () => new BpmnModdle({ activiti });
const newFlowable = () => new BpmnModdle({ flowable });
function proc(root: any): any {
return root.rootElements.find((e: any) => e.$type === 'bpmn:Process');
}
function findById(root: any, id: string): any {
return (proc(root).flowElements ?? []).find((e: any) => e.id === id);
}
function warns(res: any, re: RegExp): any[] {
return (res.warnings ?? []).filter((w: any) => re.test(String(w?.message ?? w)));
}
describe('activiti/flowable moddle 描述符 — 语料覆盖', () => {
it('§0 全部实测 activiti 属性/元素在 activiti.json 有声明', () => {
const declared = JSON.stringify(activiti);
[...CORPUS_ATTRS, ...CORPUS_ELEMENTS].forEach((n) =>
expect(declared, `activiti:${n} 未声明`).toContain(`"${n}"`));
});
it('flowable.json 声明命名空间与 flowable:assignee', () => {
expect(flowable.uri).toBe('http://flowable.org/bpmn');
expect(flowable.prefix).toBe('flowable');
expect(JSON.stringify(flowable)).toContain('"assignee"');
});
});
describe('activiti round-trip 零丢失(合成 fixture 覆盖全扩展面)', () => {
it('fromXML 干净:无 activiti 未知警告、无未解析引用(=描述符完整)', async () => {
const res = await newActiviti().fromXML(SYNTHETIC_BPMN);
expect(warns(res, /activiti|unparsable|unresolved/i)).toHaveLength(0);
// 全部流元素(含 userTask/scriptTask/boundaryEvent)都解析出来
const types = proc(res.rootElement).flowElements.map((e: any) => e.$type);
expect(types).toContain('bpmn:UserTask');
expect(types).toContain('bpmn:ScriptTask');
expect(types).toContain('bpmn:BoundaryEvent');
});
it('candidateUsers 被识别为 typed 属性且逐字保留(全角【】+ 尾空格 + JSON 原样)', async () => {
const { rootElement } = await newActiviti().fromXML(SYNTHETIC_BPMN);
const receive = findById(rootElement, 't_receive');
// 若描述符未声明 candidateUsers,值会落进 $attrs 而 .get() 返 undefined —— 该断言同时守住 typed 化。
expect(receive.get('activiti:candidateUsers')).toBe(EXPECTED_CANDIDATE_USERS);
});
it('多实例 collection/elementVariable/completionCondition 解析为结构化模型', async () => {
const { rootElement } = await newActiviti().fromXML(SYNTHETIC_BPMN);
const write = findById(rootElement, 't_write');
const mi = write.loopCharacteristics;
expect(mi.$type).toBe('bpmn:MultiInstanceLoopCharacteristics');
expect(mi.get('activiti:elementVariable')).toBe('assignee');
expect(mi.get('activiti:collection')).toContain('multiInstanceUsersHandler.getUsers');
expect(mi.get('activiti:collection')).toContain('【"items":[');
expect(mi.completionCondition.body).toBe('${nrOfCompletedInstances/nrOfInstances==1}');
});
it('taskListener + field + string + formProperty/value 解析为结构化模型', async () => {
const { rootElement } = await newActiviti().fromXML(SYNTHETIC_BPMN);
const receive = findById(rootElement, 't_receive');
const listener = receive.extensionElements.values.find(
(v: any) => v.$type === 'activiti:taskListener',
);
expect(listener.event).toBe('complete');
expect(listener.class).toBe('com.dsasp.server.wf.user.listener.TaskCompleteListener');
expect(listener.fields[0].name).toBe('mailTemplate');
expect(listener.fields[0].string).toBe('审批完成通知');
const formProp = receive.extensionElements.values.find(
(v: any) => v.$type === 'activiti:formProperty',
);
expect(formProp.id).toBe('fp_remark');
expect(formProp.values.map((v: any) => v.name)).toEqual(['同意', '驳回']);
});
it('import→export 关键片段逐字保留(实体稳定:全角【】/中文 name/formKey/监听器/多实例/timer/条件)', async () => {
const moddle = newActiviti();
const { rootElement } = await moddle.fromXML(SYNTHETIC_BPMN);
const { xml } = await moddle.toXML(rootElement, { format: false });
// 中文 name(moddle 对 name 无 NCName 限制,与 id 不同)+ DI 引用(净化后的 ASCII id)
expect(xml).toContain('name="总包合同交底"');
expect(xml).toContain('bpmnElement="Proc_zbht"');
// 办理人 / 会签 handler 前缀(引号被 moddle 序列化为数字实体 &#39;/&#34;,故断言只取到括号前)
expect(xml).toContain('getCandidateUsers(execution,');
expect(xml).toContain('multiInstanceUsersHandler.getUsers');
// 全角【】原样出现在序列化字节里(不被转义)——JSON 包裹符零丢失的直接证据
expect(xml).toContain('【');
expect(xml).toContain('】');
// 内嵌 JSON 值原样(标识符不受实体化影响)+ content 尾 4 空格(CHAR 补白)
expect(xml).toContain('projectRoleType');
expect(xml).toContain('PM_CONTRACTUALREGISTER_UPDATEPROJECTSTATUS');
expect(xml).toContain('402881343cd50391013d62ccd0c20f7d ');
// 扩展属性
expect(xml).toContain('activiti:formKey="2098ce21-400b-4425-9c22-63e350974b98"');
expect(xml).toContain('activiti:formKey="3eee7644-f51d-4755-9abb-aca7f4dd8516"');
expect(xml).toContain('activiti:exclusive="false"');
expect(xml).toContain('activiti:elementVariable="assignee"');
expect(xml).toContain('activiti:initiator="applyuser"');
expect(xml).toContain('activiti:autoStoreVariables="false"');
// 扩展元素
expect(xml).toContain('activiti:taskListener');
expect(xml).toContain('com.dsasp.server.wf.user.listener.TaskCompleteListener');
expect(xml).toContain('审批完成通知');
expect(xml).toContain('activiti:formProperty');
expect(xml).toContain('activiti:value');
// BPMN 特性:boundary+timer / conditionExpression
expect(xml).toContain('timerEventDefinition');
expect(xml).toContain('PT8H');
expect(xml).toContain('isSave==true');
expect(xml).toContain('completionCondition');
});
it('二次 round-trip 稳定:export 结果再 import,candidateUsers 仍逐字一致', async () => {
const m1 = newActiviti();
const first = await m1.fromXML(SYNTHETIC_BPMN);
const { xml } = await m1.toXML(first.rootElement, { format: true });
const m2 = newActiviti();
const { rootElement } = await m2.fromXML(xml);
expect(findById(rootElement, 't_receive').get('activiti:candidateUsers')).toBe(
EXPECTED_CANDIDATE_USERS,
);
});
});
describe('flowable 命名空间 round-trip', () => {
const FLOWABLE_BPMN = `<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:flowable="http://flowable.org/bpmn" targetNamespace="t">
<process id="p_flowable" isExecutable="true">
<userTask id="u1" name="审批" flowable:assignee="\${assignee}" flowable:formKey="k1"></userTask>
</process>
</definitions>`;
it('flowable-only 加载时 flowable:assignee typed 化并 round-trip 零丢失', async () => {
const moddle = newFlowable();
const res = await moddle.fromXML(FLOWABLE_BPMN);
const u1 = findById(res.rootElement, 'u1');
expect(u1.get('flowable:assignee')).toBe('${assignee}');
const { xml } = await moddle.toXML(res.rootElement, { format: false });
expect(xml).toContain('flowable:assignee="${assignee}"');
expect(warns(res, /flowable/i)).toHaveLength(0);
});
it('activiti-only 加载时 flowable 属性经 lax $attrs 零丢失往返(Task 1.5 Modeler 单载 activiti 的依据)', async () => {
const moddle = newActiviti();
const res = await moddle.fromXML(FLOWABLE_BPMN);
const u1 = findById(res.rootElement, 'u1');
expect(u1.$attrs['flowable:assignee']).toBe('${assignee}');
const { xml } = await moddle.toXML(res.rootElement, { format: false });
expect(xml).toContain('flowable:assignee="${assignee}"');
expect(xml).toContain('flowable:formKey="k1"');
expect(warns(res, /flowable|unparsable/i)).toHaveLength(0);
});
});
describe('moddle 约束(勘探实证,固化为回归事实)', () => {
it('D7 依据:moddle-xml 拒绝中文 id(illegal ID),故进 moddle 前必须 BpmnIdSanitizer 净化', async () => {
const CN_ID = `<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" targetNamespace="t">
<process id="总包合同交底" name="总包合同交底" isExecutable="true">
<startEvent id="s1"></startEvent>
</process>
</definitions>`;
const res = await newActiviti().fromXML(CN_ID);
// 中文 id 的 process 被判 unparsable → 整个 process 丢失(rootElements 无 bpmn:Process)
expect(warns(res, /illegal ID|总包合同交底/)).not.toHaveLength(0);
expect((res.rootElement.rootElements ?? []).some((e: any) => e.$type === 'bpmn:Process')).toBe(false);
});
it('Task 1.5 约束:activiti+flowable 双包同载会因跨包同名 extends 属性冲突丢弃 userTask', async () => {
const BOTH = `<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:activiti="http://activiti.org/bpmn" xmlns:flowable="http://flowable.org/bpmn" targetNamespace="t">
<process id="p1" isExecutable="true">
<userTask id="u1" name="审批" activiti:exclusive="false" activiti:assignee="\${a}"></userTask>
</process>
</definitions>`;
const both = new BpmnModdle({ activiti, flowable });
const res = await both.fromXML(BOTH);
expect(warns(res, /redefines|already defined/)).not.toHaveLength(0);
// userTask 被判 unparsable 而丢失 —— 证明不可两包同载,必须按命名空间隔离(见本文件 newActiviti/newFlowable)
const types = proc(res.rootElement).flowElements?.map((e: any) => e.$type) ?? [];
expect(types).not.toContain('bpmn:UserTask');
});
});

View File

@@ -0,0 +1,103 @@
// 合成 fixture:复刻 §0 实测全扩展面 + 中文 name + 全角【】办理人 JSON。
//
// 形态逐字对照真实流程「总包合同交底」(本地 eip4 库 5433 抽取):
// - candidateUsers / multiInstance collection 的内嵌 JSON 用**全角【】**包裹对象,
// 方括号 [] 是半角,引号在 XML 属性里以 &quot; 转义(本文件即真实存储态)。
// - content 尾部的 4 个空格(CHAR 补白)原样保留,用于验证空白零丢失。
// - taskListener/formProperty/field/string、boundaryEvent+timer、conditionExpression、
// startEvent initiator/formKey、scriptTask autoStoreVariables、完整 BPMNDiagram DI。
//
// ⚠️ 关键约束(本任务勘探实证):bpmn-moddle / moddle-xml 会**拒绝中文 id**(报
// `illegal ID`,id 必须是 XSD NCName 的 ASCII 子集),故 moddle 层永远只处理**净化后的
// ASCII id**。真实流程的中文 id(=流程 key,如「总包合同交底」)由 BpmnIdSanitizer(Task 1.3)
// 在进 moddle 前净化、发布时还原——那才是 D7 id 可逆净化存在的根本原因。因此本 fixture 的
// process/节点 id 用 ASCII(模拟净化后态),中文只保留在 name 里(moddle 对 name 无限制)。
// 另有独立测试固化「moddle 拒绝中文 id」这一事实。
//
// 注意:TS 模板字符串里所有引擎表达式的 `${` 均转义为 `\${`,避免被当作插值。
// 不提交任何客户真实 BPMN(P6),仅此合成件覆盖全部扩展语义。
export const SYNTHETIC_BPMN = `<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/processdef">
<process id="Proc_zbht" name="总包合同交底" isExecutable="true" activiti:candidateStarterGroups="all">
<startEvent id="start_1" name="发起" activiti:initiator="applyuser" activiti:formKey="7c9b-start-form"></startEvent>
<userTask id="t_write" name="编写交底" activiti:exclusive="false" activiti:assignee="\${assignee}" activiti:formKey="2098ce21-400b-4425-9c22-63e350974b98" activiti:dueDate="\${dueDate}" activiti:candidateGroups="managers">
<multiInstanceLoopCharacteristics isSequential="false" activiti:collection="\${multiInstanceUsersHandler.getUsers(execution,'【&quot;items&quot;:[【&quot;type&quot;:&quot;projectRoleType&quot;,&quot;content&quot;:&quot;true,false,false,false,false,false,false,false,false,false,false&quot;,&quot;isCandidate&quot;:true,&quot;isSendMail&quot;:false,&quot;isSendPhone&quot;:false,&quot;isSendMessage&quot;:false】],&quot;messageTemplate&quot;:&quot;&quot;,&quot;taskSuccessService&quot;:&quot;&quot;,&quot;isSkipInitiator&quot;:false,&quot;isNoUserSkip&quot;:false,&quot;isSkipBeforeTask&quot;:false】')}" activiti:elementVariable="assignee">
<completionCondition>\${nrOfCompletedInstances/nrOfInstances==1}</completionCondition>
</multiInstanceLoopCharacteristics>
</userTask>
<userTask id="t_receive" name="接收交底" activiti:exclusive="false" activiti:candidateUsers="\${candidateUsersHandler.getCandidateUsers(execution,'【&quot;items&quot;:[【&quot;type&quot;:&quot;position&quot;,&quot;content&quot;:&quot;402881343cd50391013d62ccd0c20f7d &quot;,&quot;isCandidate&quot;:true,&quot;isSendMail&quot;:false,&quot;isSendPhone&quot;:false,&quot;isSendMessage&quot;:false】],&quot;messageTemplate&quot;:&quot;&quot;,&quot;taskSuccessService&quot;:&quot;PM_CONTRACTUALREGISTER_UPDATEPROJECTSTATUS&quot;,&quot;isSkipInitiator&quot;:false,&quot;isNoUserSkip&quot;:false,&quot;isSkipBeforeTask&quot;:true】')}" activiti:formKey="3eee7644-f51d-4755-9abb-aca7f4dd8516">
<extensionElements>
<activiti:taskListener event="complete" class="com.dsasp.server.wf.user.listener.TaskCompleteListener">
<activiti:field name="mailTemplate">
<activiti:string>审批完成通知</activiti:string>
</activiti:field>
</activiti:taskListener>
<activiti:formProperty id="fp_remark" name="备注" type="string" required="true">
<activiti:value id="v1" name="同意"></activiti:value>
<activiti:value id="v2" name="驳回"></activiti:value>
</activiti:formProperty>
</extensionElements>
</userTask>
<boundaryEvent id="boundary_1" name="超时" attachedToRef="t_receive" cancelActivity="true">
<timerEventDefinition>
<timeDuration>PT8H</timeDuration>
</timerEventDefinition>
</boundaryEvent>
<scriptTask id="script_1" name="自动登记" scriptFormat="juel" activiti:autoStoreVariables="false">
<script>\${execution.setVariable('done', true)}</script>
</scriptTask>
<endEvent id="end_1"></endEvent>
<sequenceFlow id="f1" sourceRef="start_1" targetRef="t_write"></sequenceFlow>
<sequenceFlow id="f2" sourceRef="t_write" targetRef="t_receive"></sequenceFlow>
<sequenceFlow id="f3" sourceRef="t_receive" targetRef="script_1">
<conditionExpression xsi:type="tFormalExpression">\${isSave==true}</conditionExpression>
</sequenceFlow>
<sequenceFlow id="f4" sourceRef="script_1" targetRef="end_1"></sequenceFlow>
<sequenceFlow id="f5" sourceRef="boundary_1" targetRef="end_1"></sequenceFlow>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_Proc_zbht">
<bpmndi:BPMNPlane bpmnElement="Proc_zbht" id="BPMNPlane_Proc_zbht">
<bpmndi:BPMNShape bpmnElement="start_1" id="BPMNShape_start_1">
<omgdc:Bounds height="30.0" width="30.0" x="99.0" y="179.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="t_write" id="BPMNShape_t_write">
<omgdc:Bounds height="80.0" width="100.0" x="174.0" y="154.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="t_receive" id="BPMNShape_t_receive">
<omgdc:Bounds height="80.0" width="100.0" x="375.0" y="154.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="boundary_1" id="BPMNShape_boundary_1">
<omgdc:Bounds height="31.0" width="31.0" x="410.0" y="216.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="script_1" id="BPMNShape_script_1">
<omgdc:Bounds height="80.0" width="100.0" x="576.0" y="154.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="end_1" id="BPMNShape_end_1">
<omgdc:Bounds height="28.0" width="28.0" x="756.0" y="180.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="f1" id="BPMNEdge_f1">
<omgdi:waypoint x="129.0" y="194.0"></omgdi:waypoint>
<omgdi:waypoint x="174.0" y="194.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="f2" id="BPMNEdge_f2">
<omgdi:waypoint x="274.0" y="194.0"></omgdi:waypoint>
<omgdi:waypoint x="375.0" y="194.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="f3" id="BPMNEdge_f3">
<omgdi:waypoint x="475.0" y="194.0"></omgdi:waypoint>
<omgdi:waypoint x="576.0" y="194.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="f4" id="BPMNEdge_f4">
<omgdi:waypoint x="676.0" y="194.0"></omgdi:waypoint>
<omgdi:waypoint x="756.0" y="194.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="f5" id="BPMNEdge_f5">
<omgdi:waypoint x="425.0" y="247.0"></omgdi:waypoint>
<omgdi:waypoint x="425.0" y="320.0"></omgdi:waypoint>
<omgdi:waypoint x="770.0" y="320.0"></omgdi:waypoint>
<omgdi:waypoint x="770.0" y="208.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>`;

View File

@@ -0,0 +1,90 @@
{
"name": "Flowable",
"uri": "http://flowable.org/bpmn",
"prefix": "flowable",
"associations": [],
"types": [
{
"name": "ActivityExtension",
"isAbstract": true,
"extends": ["bpmn:Activity"],
"properties": [
{ "name": "exclusive", "isAttr": true, "type": "String" },
{ "name": "async", "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": "StartEventExtension",
"isAbstract": true,
"extends": ["bpmn:StartEvent"],
"properties": [
{ "name": "formKey", "isAttr": true, "type": "String" },
{ "name": "initiator", "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": "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": "values", "type": "value", "isMany": true }
]
},
{
"name": "value",
"superClass": ["Element"],
"properties": [
{ "name": "id", "isAttr": true, "type": "String" },
{ "name": "name", "isAttr": true, "type": "String" }
]
}
]
}