要正确打包,需要将`node_modules/bpmn-engine/index.js`中的 `const BpmnModdle = require('bpmn-moddle');`改为: `const BpmnModdle = require('bpmn-moddle').default;` 在 bpmn-elements/dist/tasks/LoopCharacteristics.js from line 169: ``` ParallelLoopCharacteristics.prototype._onCompleteMessage = function onCompleteMessage(routingKey, message) { const chr = this.characteristics; const { content } = message; if (content.output !== undefined) chr.output[content.index] = content.output; if (routingKey === 'execute.discard') { this.discarded++; } this.running--; this.activity.broker.publish('execution', 'execute.iteration.completed', { ...content, ...chr.getContent(), index: this.index, // >>>>>>> 这行要删除 running: this.running, discarded: this.discarded, output: chr.output, state: 'iteration.completed', preventComplete: true }); ``` 立项申请 ```json { "type": "object", "title": "条件", "required": [ "memo" ], "ui:order": [ "memo", "files" ], "properties": { "memo": { "type": "string", "title": "立项申请理由", "format": "textarea", "minRows": 10, "description": "请输入立项申请的相关说明" }, "files": { "type": "upload", "title": "立项文件", "ui:options": { "type": "upload", "accept": ".doc,.docx,application/msword", "limitCount": 1 }, "description": "上传立项相关文件,如可行性报告等" } } } ``` 立项审核 ```json { "type": "object", "title": "条件", "required": [ "pass" ], "ui:order": [ "memo", "files", "pass", "opinion" ], "properties": { "memo": { "type": "string", "title": "申请理由", "format": "textarea", "default": "${environment.output.task_request.memo}", "readonly": true }, "files": { "type": "download", "title": "立项文件", "default": ${JSON.stringify(environment.output.task_request.files)} }, "pass": { "type": "boolean", "title": "是否通过审核?", "default": false }, "opinion": { "type": "string", "title": "审核意见", "format": "textarea", "default": "", "minRows": 6, "minLength": 10, "ui:options": { "rows": 10, "type": "textarea" } } } } ``` 选择审核方式 ```json { "type": "object", "title": "选择审核方式", "required": [], "ui:order": [ "check_type" ], "properties": { "check_type": { "enum": [ 1, 2 ], "type": "integer", "title": "审核方式", "enumNames": [ "顺序审核", "并行审核" ], "description": "审核方式,目前是并行和串行" } } } ``` 任务审核 ```json { "type": "object", "title": "条件", "required": [ "pass" ], "ui:order": [ "pass", "opinion", "annotated_draft" ], "properties": { "pass": { "type": "boolean", "title": "是否通过?", "default": false }, "opinion": { "type": "upload", "title": "审核意见", "ui:options": { "type": "upload", "accept": ".doc,.docx,application/msword", "limitCount": 1 } }, "annotated_draft": { "type": "upload", "title": "批注稿", "ui:options": { "type": "upload", "accept": ".doc,.docx,application/msword", "limitCount": 1 } } } } ``` 运行过程中,内部js的环境:environment ```json { "output": { "task_request_task": { "id": "task_request_task", "executionId": "task_request_task_8b0c71a536", "user_id": "admin", "check_type": 1 } }, "variables": { "prj_id": "63f331ea0f400000", "owner": "admin", "task_id": "63f3321769400000", "fields": { "routingKey": "run.execute", "exchange": "run", "consumerTag": "_process-run" }, "content": { "id": "ProcessOutcomeApprove", "type": "bpmn:Process", "name": "立项审批流程", "executionId": "ProcessOutcomeApprove_ab7febc2ca", "parent": { "id": "sample-diagram", "type": "bpmn:Definitions" } }, "properties": { "messageId": "smq.mid-2a55e1a76c", "timestamp": 1717127830563 }, "check_type": 1 } } ```