|
@@ -1,6 +1,6 @@
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="sample-diagram" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.22.0" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
|
|
|
- <bpmn2:process id="ProcessOutcomeApprove" name="立项审批流程" isExecutable="true" camunda:versionTag="1.0">
|
|
|
+ <bpmn2:process id="ProcessOutcomeApprove" name="任务审核流程" isExecutable="true" camunda:versionTag="1.0">
|
|
|
<bpmn2:startEvent id="event_start">
|
|
|
<bpmn2:extensionElements>
|
|
|
<camunda:properties>
|
|
@@ -18,6 +18,37 @@
|
|
|
<camunda:inputParameter name="draft">${true}</camunda:inputParameter>
|
|
|
<camunda:inputParameter name="task_id">${environment.variables.task_id}</camunda:inputParameter>
|
|
|
</camunda:inputOutput>
|
|
|
+ <camunda:executionListener event="end">
|
|
|
+ <camunda:script scriptFormat="JavaScript">
|
|
|
+(async function () {
|
|
|
+ // 提交审核
|
|
|
+ try {
|
|
|
+ let owner = await this.environment.services.owner(); // 获取任务责任人
|
|
|
+ if (!owner) {
|
|
|
+ await this.environment.services.gen_warn_task('admin', '提交任务审核时未找到负责人',
|
|
|
+ `提交任务审核时未找到负责人,流程出错。case id: ${this.environment.variables.id}`);
|
|
|
+ }
|
|
|
+ // 获取任务审核人列表
|
|
|
+ let checkers = await this.environment.services.get_handlers('task_checker');
|
|
|
+ if (!checkers || checkers.length === 0) return;
|
|
|
+ let checkers_str = "";
|
|
|
+ for (var i = 0; i < checkers.length; i++) {
|
|
|
+ checkers_str += `<b>${checkers[i].name}</b> 进行${checkers[i].action};<br>`;
|
|
|
+ }
|
|
|
+ let check_type = this.environment.variables.check_type;
|
|
|
+ let check_type_str = check_type === 2 ? "并行审核": "顺序审核";
|
|
|
+ await this.environment.services.gen_remind_task(owner.id, `任务“${this.environment.variables.task_name}”的审核申请已提交`, `<b>${owner.name}</b>已于 <b>` +
|
|
|
+ this.environment.services.get_datetime() + `</b> 提交了任务<b>“${this.environment.variables.task_name}”</b>的审核申请,将由: <br> ${checkers_str}审核方式为:${check_type_str}`);
|
|
|
+ await this.environment.services.logger(owner.id, owner.name, `提交了任务<b>“${this.environment.variables.task_name}”</b>的审核申请,将由: <br> ${checkers_str}审核方式为:${check_type_str}`);
|
|
|
+
|
|
|
+ } catch (e) {
|
|
|
+ this.environment.Logger('work').error(e);
|
|
|
+ }
|
|
|
+})();
|
|
|
+
|
|
|
+ </camunda:script>
|
|
|
+ </camunda:executionListener>
|
|
|
+ <camunda:taskListener class="" event="assignment" />
|
|
|
</bpmn2:extensionElements>
|
|
|
<bpmn2:incoming>Flow_1t45qnv</bpmn2:incoming>
|
|
|
<bpmn2:incoming>Flow_0gyvyyo</bpmn2:incoming>
|
|
@@ -27,13 +58,79 @@
|
|
|
</bpmn2:userTask>
|
|
|
<bpmn2:sequenceFlow id="Flow_15zn1tu" sourceRef="event_start" targetRef="task_do_task" />
|
|
|
<bpmn2:sequenceFlow id="Flow_1rg4oob" sourceRef="task_request_task" targetRef="Gateway_1whgd2i">
|
|
|
- <bpmn2:documentation>状态变为申请审核(40)</bpmn2:documentation>
|
|
|
+ <bpmn2:documentation>状态变为审核中(50)</bpmn2:documentation>
|
|
|
<bpmn2:extensionElements>
|
|
|
<camunda:properties>
|
|
|
- <camunda:property name="task_status" value="40" />
|
|
|
+ <camunda:property name="task_status" value="50" />
|
|
|
+ <camunda:property name="task_status_name" value="任务审核中" />
|
|
|
</camunda:properties>
|
|
|
</bpmn2:extensionElements>
|
|
|
</bpmn2:sequenceFlow>
|
|
|
+ <bpmn2:userTask id="task_approve_task_sync" name="审核任务成果" camunda:formKey="task_approve" camunda:assignee="task_checker">
|
|
|
+ <bpmn2:documentation>状态变为审核中(50)</bpmn2:documentation>
|
|
|
+ <bpmn2:extensionElements>
|
|
|
+ <camunda:inputOutput>
|
|
|
+ <camunda:inputParameter name="show_in_my_works">${true}</camunda:inputParameter>
|
|
|
+ <camunda:inputParameter name="process_type">${1}</camunda:inputParameter>
|
|
|
+ <camunda:inputParameter name="target_type"> project-plan</camunda:inputParameter>
|
|
|
+ <camunda:inputParameter name="prj_id">${environment.variables.prj_id}</camunda:inputParameter>
|
|
|
+ <camunda:inputParameter name="draft">${false}</camunda:inputParameter>
|
|
|
+ <camunda:inputParameter name="task_id">${environment.variables.task_id}</camunda:inputParameter>
|
|
|
+ </camunda:inputOutput>
|
|
|
+ <camunda:executionListener event="end">
|
|
|
+ <camunda:script scriptFormat="JavaScript">
|
|
|
+(async function () {
|
|
|
+ try {
|
|
|
+ // 并行审核任务,多人同时执行
|
|
|
+ let owner = await this.environment.services.owner(); // 获取任务责任人
|
|
|
+ if (!owner) {
|
|
|
+ await this.environment.services.gen_warn_task('admin', '任务审核时未找到负责人',
|
|
|
+ `任务审核时未找到负责人,流程出错。case id: ${this.environment.variables.id}`);
|
|
|
+ }
|
|
|
+ this.environment.Logger('work').debug(this.content);
|
|
|
+ let checker = this.content.handlers[this.content.index]; // 获取当前审核人,这个是并行审核任务,有多个审核人并行审核
|
|
|
+ let result = this.content.output[this.content.index]; // 来自于审核人表单结果
|
|
|
+ if (result.pass) { // 如果审核通过
|
|
|
+ // 生成阅读任务
|
|
|
+ await this.environment.services.gen_remind_task(owner.id, `${checker.name}:任务“${this.environment.variables.task_name}”的${checker.action}已通过`,
|
|
|
+ `<b>${checker.name}</b>已于 <b>${this.environment.services.get_datetime()}</b> 对任务“${this.environment.variables.task_name}”的交付物进行了${checker.action}并<span style="color: rgb(20, 201, 201);">通过。</span>`);
|
|
|
+ // 生成任务动态
|
|
|
+ await this.environment.services.logger(checker.id, checker.name, `任务“${this.environment.variables.task_name}”的${checker.action}<span style="color: rgb(20, 201, 201);">已通过</span>`);
|
|
|
+ // 归档审核文件
|
|
|
+ if (result.opinion) {
|
|
|
+ await this.environment.services.place_on_files(result.opinion, `${checker.action}意见(通过)`);
|
|
|
+ }
|
|
|
+ if (result.annotated_draft) {
|
|
|
+ await this.environment.services.place_on_files(result.annotated_draft, `${checker.action}批注稿(通过)`);
|
|
|
+ }
|
|
|
+
|
|
|
+ } else {
|
|
|
+ // 生成阅读任务
|
|
|
+ await this.environment.services.gen_remind_task(owner.id, `${checker.name}任务“${this.environment.variables.task_name}”的${checker.action}已驳回`,
|
|
|
+ `<b>${checker.name}</b>已于 <b>${this.environment.services.get_datetime()}</b> 对任务“${this.environment.variables.task_name}”的交付物进行了${checker.action}并<span style="color: red;">驳回。</span>`);
|
|
|
+ // 生成任务动态
|
|
|
+ await this.environment.services.logger(checker.id, checker.name, `任务“${this.environment.variables.task_name}”在${checker.action}时<span style="color: red;">被驳回</span>`);
|
|
|
+ // 归档审核文件
|
|
|
+ if (result.opinion) {
|
|
|
+ await this.environment.services.place_on_files(result.opinion, `${checker.action}意见(驳回)`);
|
|
|
+ }
|
|
|
+ if (result.annotated_draft) {
|
|
|
+ await this.environment.services.place_on_files(result.annotated_draft, `${checker.action}批注稿(驳回)`);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (e) {
|
|
|
+ this.environment.Logger('work').error(e);
|
|
|
+ }
|
|
|
+})();
|
|
|
+</camunda:script>
|
|
|
+ </camunda:executionListener>
|
|
|
+ </bpmn2:extensionElements>
|
|
|
+ <bpmn2:incoming>Flow_0iv9g3p</bpmn2:incoming>
|
|
|
+ <bpmn2:outgoing>Flow_1su3b3p</bpmn2:outgoing>
|
|
|
+ <bpmn2:multiInstanceLoopCharacteristics camunda:collection="${content.handlers}" camunda:elementVariable="handler">
|
|
|
+ <bpmn2:loopCardinality xsi:type="bpmn2:tFormalExpression">${content.handlers.length}</bpmn2:loopCardinality>
|
|
|
+ </bpmn2:multiInstanceLoopCharacteristics>
|
|
|
+ </bpmn2:userTask>
|
|
|
<bpmn2:userTask id="task_approve_task_async" name="审核任务成果" camunda:formKey="task_approve" camunda:assignee="task_checker">
|
|
|
<bpmn2:documentation>状态变为审核中(50)</bpmn2:documentation>
|
|
|
<bpmn2:extensionElements>
|
|
@@ -42,10 +139,56 @@
|
|
|
<camunda:inputParameter name="process_type">${1}</camunda:inputParameter>
|
|
|
<camunda:inputParameter name="target_type"> project-plan</camunda:inputParameter>
|
|
|
<camunda:inputParameter name="prj_id">${environment.variables.prj_id}</camunda:inputParameter>
|
|
|
- <camunda:inputParameter name="task_status">${50}</camunda:inputParameter>
|
|
|
<camunda:inputParameter name="draft">${false}</camunda:inputParameter>
|
|
|
<camunda:inputParameter name="task_id">${environment.variables.task_id}</camunda:inputParameter>
|
|
|
</camunda:inputOutput>
|
|
|
+ <camunda:executionListener event="end">
|
|
|
+ <camunda:script scriptFormat="JavaScript">
|
|
|
+(async function () {
|
|
|
+ try {
|
|
|
+ // 串行审核任务,多人按顺序执行审核
|
|
|
+ let owner = await this.environment.services.owner(); // 获取任务责任人
|
|
|
+ if (!owner) {
|
|
|
+ await this.environment.services.gen_warn_task('admin', '任务审核时未找到负责人',
|
|
|
+ `任务审核时未找到负责人,流程出错。case id: ${this.environment.variables.id}`);
|
|
|
+ }
|
|
|
+ this.environment.Logger('work').debug(this.content);
|
|
|
+ let checker = this.content.handlers[this.content.index]; // 获取当前审核人,这个是并行审核任务,有多个审核人并行审核
|
|
|
+ let result = this.content.output[this.content.index]; // 来自于审核人表单结果
|
|
|
+ if (result.pass) { // 如果审核通过
|
|
|
+ // 生成阅读任务
|
|
|
+ await this.environment.services.gen_remind_task(owner.id, `${checker.name}:任务“${this.environment.variables.task_name}”的${checker.action}已通过`,
|
|
|
+ `<b>${checker.name}</b>已于 <b>${this.environment.services.get_datetime()}</b> 对任务“${this.environment.variables.task_name}”的交付物进行了${checker.action}并<span style="color: rgb(20, 201, 201);">通过。</span>。`);
|
|
|
+ // 生成任务动态
|
|
|
+ await this.environment.services.logger(checker.id, checker.name, `任务“${this.environment.variables.task_name}”的${checker.action}<span style="color: rgb(20, 201, 201);">已通过</span>`);
|
|
|
+ // 归档审核文件
|
|
|
+ if (result.opinion) {
|
|
|
+ await this.environment.services.place_on_files(result.opinion, `${checker.action}意见(通过)`);
|
|
|
+ }
|
|
|
+ if (result.annotated_draft) {
|
|
|
+ await this.environment.services.place_on_files(result.annotated_draft, `${checker.action}批注稿(通过)`);
|
|
|
+ }
|
|
|
+
|
|
|
+ } else {
|
|
|
+ // 生成阅读任务
|
|
|
+ await this.environment.services.gen_remind_task(owner.id, `${checker.name}:任务“${this.environment.variables.task_name}”的${checker.action}已驳回`,
|
|
|
+ `<b>${checker.name}</b>已于 <b>${this.environment.services.get_datetime()}</b> 对任务“${this.environment.variables.task_name}”的交付物进行了${checker.action}并<span style="color: red;">驳回。</span>。`);
|
|
|
+ // 生成任务动态
|
|
|
+ await this.environment.services.logger(checker.id, checker.name, `任务“${this.environment.variables.task_name}”在${checker.action}时<span style="color: red;">被驳回</span>`);
|
|
|
+ // 归档审核文件
|
|
|
+ if (result.opinion) {
|
|
|
+ await this.environment.services.place_on_files(result.opinion, `${checker.action}意见(驳回)`);
|
|
|
+ }
|
|
|
+ if (result.annotated_draft) {
|
|
|
+ await this.environment.services.place_on_files(result.annotated_draft, `${checker.action}批注稿(驳回)`);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (e) {
|
|
|
+ this.environment.Logger('work').error(e);
|
|
|
+ }
|
|
|
+})();
|
|
|
+ </camunda:script>
|
|
|
+ </camunda:executionListener>
|
|
|
</bpmn2:extensionElements>
|
|
|
<bpmn2:incoming>Flow_02nannf</bpmn2:incoming>
|
|
|
<bpmn2:outgoing>Flow_193tusd</bpmn2:outgoing>
|
|
@@ -65,6 +208,7 @@
|
|
|
<bpmn2:extensionElements>
|
|
|
<camunda:properties>
|
|
|
<camunda:property name="task_status" value="100" />
|
|
|
+ <camunda:property name="task_status_name" value="任务审核通过" />
|
|
|
</camunda:properties>
|
|
|
</bpmn2:extensionElements>
|
|
|
<bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" language="JavaScript">next(null, this.environment.variables.pass===true);</bpmn2:conditionExpression>
|
|
@@ -74,6 +218,7 @@
|
|
|
<bpmn2:extensionElements>
|
|
|
<camunda:properties>
|
|
|
<camunda:property name="task_status" value="30" />
|
|
|
+ <camunda:property name="task_status_name" value="任务审核未通过" />
|
|
|
</camunda:properties>
|
|
|
</bpmn2:extensionElements>
|
|
|
</bpmn2:sequenceFlow>
|
|
@@ -83,6 +228,24 @@
|
|
|
<camunda:inputOutput>
|
|
|
<camunda:inputParameter name="process_type">${1}</camunda:inputParameter>
|
|
|
</camunda:inputOutput>
|
|
|
+ <camunda:executionListener event="end">
|
|
|
+ <camunda:script scriptFormat="JavaScript">
|
|
|
+(async function() {
|
|
|
+ try{
|
|
|
+ let owner = await this.environment.services.owner(); // 获取任务责任人
|
|
|
+ if (!owner) {
|
|
|
+ await this.environment.services.gen_warn_task('admin', '任务审核申请被撤回时未找到负责人',
|
|
|
+ `任务审核申请被撤回时未找到负责人,流程出错。case id: ${this.environment.variables.id}`);
|
|
|
+ }
|
|
|
+ await this.environment.services.gen_remind_task(owner.id, `任务“${this.environment.variables.task_name}”的审核申请已被撤回`,
|
|
|
+ `${owner.name}已于 ${this.environment.services.get_datetime()} <span style="color: rgb(22,93,255);">撤回</span>了任务<b>“${this.environment.variables.task_name}”</b>的审核申请。`);
|
|
|
+ await this.environment.services.logger(owner.id, owner.name, `撤回了任务<b>“${this.environment.variables.task_name}”</b>的审核申请。`);
|
|
|
+ } catch(e){
|
|
|
+ this.environment.Logger('work').error(e);
|
|
|
+ }
|
|
|
+})();
|
|
|
+</camunda:script>
|
|
|
+ </camunda:executionListener>
|
|
|
</bpmn2:extensionElements>
|
|
|
<bpmn2:incoming>Flow_0bhibn0</bpmn2:incoming>
|
|
|
<bpmn2:outgoing>Flow_0tj9nd6</bpmn2:outgoing>
|
|
@@ -98,7 +261,7 @@
|
|
|
<bpmn2:incoming>Flow_0tj9nd6</bpmn2:incoming>
|
|
|
<bpmn2:signalEventDefinition id="SignalEventDefinition_1tt7p06" signalRef="Signal_0hhmd7l" />
|
|
|
</bpmn2:intermediateThrowEvent>
|
|
|
- <bpmn2:sequenceFlow id="Flow_02taytj" sourceRef="event_throw_approved" targetRef="Event_end">
|
|
|
+ <bpmn2:sequenceFlow id="Flow_02taytj" sourceRef="event_throw_approved" targetRef="Activity_10ywpg4">
|
|
|
<bpmn2:extensionElements />
|
|
|
</bpmn2:sequenceFlow>
|
|
|
<bpmn2:intermediateThrowEvent id="event_throw_approved" name="已审核事件">
|
|
@@ -120,7 +283,7 @@
|
|
|
<bpmn2:sequenceFlow id="Flow_0nzbvpg" sourceRef="Event_catch_withdraw" targetRef="task_modify_task1">
|
|
|
<bpmn2:extensionElements />
|
|
|
</bpmn2:sequenceFlow>
|
|
|
- <bpmn2:sequenceFlow id="Flow_06cxzjx" sourceRef="event_throw_approved_back" targetRef="Activity_1dcslsv" />
|
|
|
+ <bpmn2:sequenceFlow id="Flow_06cxzjx" sourceRef="event_throw_approved_back" targetRef="Activity_0cir5fq" />
|
|
|
<bpmn2:manualTask id="task_do_task" name="实施任务工作">
|
|
|
<bpmn2:incoming>Flow_15zn1tu</bpmn2:incoming>
|
|
|
<bpmn2:outgoing>Flow_0gyvyyo</bpmn2:outgoing>
|
|
@@ -129,26 +292,14 @@
|
|
|
<bpmn2:extensionElements />
|
|
|
</bpmn2:sequenceFlow>
|
|
|
<bpmn2:manualTask id="task_modify_task1" name="修改交付物">
|
|
|
- <bpmn2:incoming>Flow_06kumr8</bpmn2:incoming>
|
|
|
<bpmn2:incoming>Flow_0nzbvpg</bpmn2:incoming>
|
|
|
+ <bpmn2:incoming>Flow_1eauhgu</bpmn2:incoming>
|
|
|
<bpmn2:outgoing>Flow_1t45qnv</bpmn2:outgoing>
|
|
|
</bpmn2:manualTask>
|
|
|
- <bpmn2:scriptTask id="Activity_1dcslsv" name="提醒审核被驳回" scriptFormat="Javascript">
|
|
|
- <bpmn2:extensionElements />
|
|
|
- <bpmn2:incoming>Flow_06cxzjx</bpmn2:incoming>
|
|
|
- <bpmn2:outgoing>Flow_06kumr8</bpmn2:outgoing>
|
|
|
- <bpmn2:script>this.environment.services.get_handlers('owner').then((handlers) => {
|
|
|
-for (var i = 0; i < handlers.length; i++) {
|
|
|
- this.environment.services.gen_remind_task(handlers[i].id, '任务审核被驳回', '任务审核被驳回');
|
|
|
-}
|
|
|
-next();
|
|
|
-});</bpmn2:script>
|
|
|
- </bpmn2:scriptTask>
|
|
|
<bpmn2:endEvent id="Event_end">
|
|
|
<bpmn2:incoming>Flow_1ucg773</bpmn2:incoming>
|
|
|
- <bpmn2:incoming>Flow_02taytj</bpmn2:incoming>
|
|
|
+ <bpmn2:incoming>Flow_1xp7bfo</bpmn2:incoming>
|
|
|
</bpmn2:endEvent>
|
|
|
- <bpmn2:sequenceFlow id="Flow_06kumr8" sourceRef="Activity_1dcslsv" targetRef="task_modify_task1" />
|
|
|
<bpmn2:boundaryEvent id="Event_catch_withdraw" name="撤回" attachedToRef="task_approve_task_async">
|
|
|
<bpmn2:outgoing>Flow_0nzbvpg</bpmn2:outgoing>
|
|
|
<bpmn2:signalEventDefinition id="SignalEventDefinition_111s194" signalRef="Signal_0hhmd7l" />
|
|
@@ -159,27 +310,8 @@ next();
|
|
|
<bpmn2:outgoing>Flow_0iv9g3p</bpmn2:outgoing>
|
|
|
</bpmn2:exclusiveGateway>
|
|
|
<bpmn2:sequenceFlow id="Flow_02nannf" sourceRef="Gateway_1whgd2i" targetRef="task_approve_task_async" />
|
|
|
- <bpmn2:userTask id="task_approve_task_sync" name="审核任务成果" camunda:formKey="task_approve" camunda:assignee="task_checker">
|
|
|
- <bpmn2:documentation>状态变为审核中(50)</bpmn2:documentation>
|
|
|
- <bpmn2:extensionElements>
|
|
|
- <camunda:inputOutput>
|
|
|
- <camunda:inputParameter name="show_in_my_works">${true}</camunda:inputParameter>
|
|
|
- <camunda:inputParameter name="process_type">${1}</camunda:inputParameter>
|
|
|
- <camunda:inputParameter name="target_type"> project-plan</camunda:inputParameter>
|
|
|
- <camunda:inputParameter name="prj_id">${environment.variables.prj_id}</camunda:inputParameter>
|
|
|
- <camunda:inputParameter name="task_status">${50}</camunda:inputParameter>
|
|
|
- <camunda:inputParameter name="draft">${false}</camunda:inputParameter>
|
|
|
- <camunda:inputParameter name="task_id">${environment.variables.task_id}</camunda:inputParameter>
|
|
|
- </camunda:inputOutput>
|
|
|
- </bpmn2:extensionElements>
|
|
|
- <bpmn2:incoming>Flow_0iv9g3p</bpmn2:incoming>
|
|
|
- <bpmn2:outgoing>Flow_1su3b3p</bpmn2:outgoing>
|
|
|
- <bpmn2:multiInstanceLoopCharacteristics camunda:collection="${content.handlers}" camunda:elementVariable="handler">
|
|
|
- <bpmn2:loopCardinality xsi:type="bpmn2:tFormalExpression">${content.handlers.length}</bpmn2:loopCardinality>
|
|
|
- </bpmn2:multiInstanceLoopCharacteristics>
|
|
|
- </bpmn2:userTask>
|
|
|
<bpmn2:sequenceFlow id="Flow_0iv9g3p" sourceRef="Gateway_1whgd2i" targetRef="task_approve_task_sync">
|
|
|
- <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" language="JavaScript">next(null, this.environment.variables.check_type===1);</bpmn2:conditionExpression>
|
|
|
+ <bpmn2:conditionExpression xsi:type="bpmn2:tFormalExpression" language="JavaScript">next(null, this.environment.variables.check_type===2);</bpmn2:conditionExpression>
|
|
|
</bpmn2:sequenceFlow>
|
|
|
<bpmn2:sequenceFlow id="Flow_1su3b3p" sourceRef="task_approve_task_sync" targetRef="Activity_0gfds7w" />
|
|
|
<bpmn2:sequenceFlow id="Flow_0b7s3zy" sourceRef="Event_1gpzq6w" targetRef="task_modify_task2" />
|
|
@@ -196,7 +328,9 @@ next();
|
|
|
<bpmn2:scriptTask id="Activity_0gfds7w" name="计算审核结果" scriptFormat="JavaScript">
|
|
|
<bpmn2:incoming>Flow_1su3b3p</bpmn2:incoming>
|
|
|
<bpmn2:outgoing>Flow_1rcwh5r</bpmn2:outgoing>
|
|
|
- <bpmn2:script>// 只要有一个未通过,就算未通过审核
|
|
|
+ <bpmn2:script>
|
|
|
+try {
|
|
|
+// 只要有一个未通过,就算未通过审核
|
|
|
var passed = true;
|
|
|
let a = this.environment.services.get_value('a');
|
|
|
for (var i = 0; i < this.environment.output.task_approve_task_sync.length; i++) {
|
|
@@ -207,7 +341,69 @@ for (var i = 0; i < this.environment.output.task_approve_task_sync.length; i+
|
|
|
}
|
|
|
}
|
|
|
this.environment.variables.pass = passed;
|
|
|
-next();</bpmn2:script>
|
|
|
+} catch (e) {
|
|
|
+ this.environment.variables.pass = false;
|
|
|
+} finally {
|
|
|
+ next();
|
|
|
+}
|
|
|
+ </bpmn2:script>
|
|
|
+ </bpmn2:scriptTask>
|
|
|
+ <bpmn2:sequenceFlow id="Flow_09c65ah" sourceRef="Activity_0cir5fq" targetRef="Activity_0c44yrz" />
|
|
|
+ <bpmn2:scriptTask id="Activity_0cir5fq" name="归档交付物文件" scriptFormat="JavaScript">
|
|
|
+ <bpmn2:incoming>Flow_06cxzjx</bpmn2:incoming>
|
|
|
+ <bpmn2:outgoing>Flow_09c65ah</bpmn2:outgoing>
|
|
|
+ <bpmn2:script>
|
|
|
+(async function () {
|
|
|
+ try {
|
|
|
+ await this.environment.services.place_on_outcome("内部审核驳回");
|
|
|
+ } catch (e) {
|
|
|
+ this.environment.Logger('work').error(e);
|
|
|
+ } finally {
|
|
|
+ next();
|
|
|
+ }
|
|
|
+})();
|
|
|
+ </bpmn2:script>
|
|
|
+ </bpmn2:scriptTask>
|
|
|
+ <bpmn2:sequenceFlow id="Flow_1xp7bfo" sourceRef="Activity_10ywpg4" targetRef="Event_end" />
|
|
|
+ <bpmn2:scriptTask id="Activity_10ywpg4" name="归档交付物文件" scriptFormat="JavaScript">
|
|
|
+ <bpmn2:incoming>Flow_02taytj</bpmn2:incoming>
|
|
|
+ <bpmn2:outgoing>Flow_1xp7bfo</bpmn2:outgoing>
|
|
|
+ <bpmn2:script>
|
|
|
+(async function () {
|
|
|
+ try {
|
|
|
+ await this.environment.services.place_on_outcome("内部审核通过", "outcome");
|
|
|
+ } catch (e) {
|
|
|
+ this.environment.Logger('work').error(e);
|
|
|
+ } finally {
|
|
|
+ next();
|
|
|
+ }
|
|
|
+})();
|
|
|
+ </bpmn2:script>
|
|
|
+ </bpmn2:scriptTask>
|
|
|
+ <bpmn2:sequenceFlow id="Flow_1eauhgu" sourceRef="Activity_0c44yrz" targetRef="task_modify_task1" />
|
|
|
+ <bpmn2:scriptTask id="Activity_0c44yrz" name="提醒审核未通过" scriptFormat="JavaScript">
|
|
|
+ <bpmn2:incoming>Flow_09c65ah</bpmn2:incoming>
|
|
|
+ <bpmn2:outgoing>Flow_1eauhgu</bpmn2:outgoing>
|
|
|
+ <bpmn2:script>
|
|
|
+(async function () {
|
|
|
+ try {
|
|
|
+ let owner = await this.environment.services.owner(); // 获取任务责任人
|
|
|
+ if (!owner) {
|
|
|
+ await this.environment.services.gen_warn_task('admin', '提交任务审核时未找到负责人',
|
|
|
+ `提交任务审核时未找到负责人,流程出错。case id: ${this.environment.variables.id}`);
|
|
|
+ }
|
|
|
+ // 生成阅读任务
|
|
|
+ await this.environment.services.gen_remind_task(owner.id, `任务“${this.environment.variables.task_name}”的交付物审核未通过。`,
|
|
|
+ `任务“${this.environment.variables.task_name}”的交付物审核未通过,请修改后重新提交审核。`);
|
|
|
+ // 生成任务动态
|
|
|
+ await this.environment.services.logger(checker.id, checker.name, `任务“${this.environment.variables.task_name}”的交付物审核未通过。`);
|
|
|
+ } catch (e) {
|
|
|
+ this.environment.Logger('work').error(e);
|
|
|
+ } finally {
|
|
|
+ next();
|
|
|
+ }
|
|
|
+})();
|
|
|
+ </bpmn2:script>
|
|
|
</bpmn2:scriptTask>
|
|
|
<bpmn2:textAnnotation id="TextAnnotation_1vnw6c1">
|
|
|
<bpmn2:text>所有人都审核通过才算通过</bpmn2:text>
|
|
@@ -227,12 +423,16 @@ next();</bpmn2:script>
|
|
|
<dc:Bounds x="380" y="240" width="100" height="80" />
|
|
|
<bpmndi:BPMNLabel />
|
|
|
</bpmndi:BPMNShape>
|
|
|
+ <bpmndi:BPMNShape id="Activity_1wy7wpe_di" bpmnElement="task_approve_task_sync">
|
|
|
+ <dc:Bounds x="630" y="170" width="100" height="80" />
|
|
|
+ <bpmndi:BPMNLabel />
|
|
|
+ </bpmndi:BPMNShape>
|
|
|
<bpmndi:BPMNShape id="Activity_0ds6ym0_di" bpmnElement="task_approve_task_async">
|
|
|
<dc:Bounds x="630" y="305" width="100" height="80" />
|
|
|
<bpmndi:BPMNLabel />
|
|
|
</bpmndi:BPMNShape>
|
|
|
<bpmndi:BPMNShape id="Gateway_06baw71_di" bpmnElement="gateway_approved" isMarkerVisible="true">
|
|
|
- <dc:Bounds x="905" y="255" width="50" height="50" />
|
|
|
+ <dc:Bounds x="995" y="255" width="50" height="50" />
|
|
|
</bpmndi:BPMNShape>
|
|
|
<bpmndi:BPMNShape id="Activity_0fonc56_di" bpmnElement="task_with_draw_task">
|
|
|
<dc:Bounds x="450" y="630" width="100" height="80" />
|
|
@@ -245,15 +445,15 @@ next();</bpmn2:script>
|
|
|
</bpmndi:BPMNLabel>
|
|
|
</bpmndi:BPMNShape>
|
|
|
<bpmndi:BPMNShape id="Event_0tntlum_di" bpmnElement="event_throw_approved">
|
|
|
- <dc:Bounds x="1032" y="262" width="36" height="36" />
|
|
|
+ <dc:Bounds x="1122" y="262" width="36" height="36" />
|
|
|
<bpmndi:BPMNLabel>
|
|
|
- <dc:Bounds x="1023" y="305" width="55" height="14" />
|
|
|
+ <dc:Bounds x="1113" y="305" width="55" height="14" />
|
|
|
</bpmndi:BPMNLabel>
|
|
|
</bpmndi:BPMNShape>
|
|
|
<bpmndi:BPMNShape id="Event_1gjhb1n_di" bpmnElement="event_throw_approved_back">
|
|
|
- <dc:Bounds x="912" y="442" width="36" height="36" />
|
|
|
+ <dc:Bounds x="1002" y="382" width="36" height="36" />
|
|
|
<bpmndi:BPMNLabel>
|
|
|
- <dc:Bounds x="952" y="453" width="55" height="14" />
|
|
|
+ <dc:Bounds x="1042" y="393" width="55" height="14" />
|
|
|
</bpmndi:BPMNLabel>
|
|
|
</bpmndi:BPMNShape>
|
|
|
<bpmndi:BPMNShape id="Activity_0isolrc_di" bpmnElement="task_do_task">
|
|
@@ -264,19 +464,12 @@ next();</bpmn2:script>
|
|
|
<dc:Bounds x="460" y="460" width="100" height="80" />
|
|
|
<bpmndi:BPMNLabel />
|
|
|
</bpmndi:BPMNShape>
|
|
|
- <bpmndi:BPMNShape id="Activity_1fktaxz_di" bpmnElement="Activity_1dcslsv">
|
|
|
- <dc:Bounds x="800" y="460" width="100" height="80" />
|
|
|
- </bpmndi:BPMNShape>
|
|
|
<bpmndi:BPMNShape id="Event_1jljt88_di" bpmnElement="Event_end">
|
|
|
- <dc:Bounds x="1132" y="262" width="36" height="36" />
|
|
|
+ <dc:Bounds x="1352" y="262" width="36" height="36" />
|
|
|
</bpmndi:BPMNShape>
|
|
|
<bpmndi:BPMNShape id="Gateway_1whgd2i_di" bpmnElement="Gateway_1whgd2i" isMarkerVisible="true">
|
|
|
<dc:Bounds x="525" y="255" width="50" height="50" />
|
|
|
</bpmndi:BPMNShape>
|
|
|
- <bpmndi:BPMNShape id="Activity_1wy7wpe_di" bpmnElement="task_approve_task_sync">
|
|
|
- <dc:Bounds x="630" y="170" width="100" height="80" />
|
|
|
- <bpmndi:BPMNLabel />
|
|
|
- </bpmndi:BPMNShape>
|
|
|
<bpmndi:BPMNShape id="Activity_09ebfre_di" bpmnElement="task_modify_task2">
|
|
|
<dc:Bounds x="480" y="80" width="100" height="80" />
|
|
|
</bpmndi:BPMNShape>
|
|
@@ -284,6 +477,18 @@ next();</bpmn2:script>
|
|
|
<dc:Bounds x="760" y="170" width="100" height="80" />
|
|
|
<bpmndi:BPMNLabel />
|
|
|
</bpmndi:BPMNShape>
|
|
|
+ <bpmndi:BPMNShape id="Activity_1s88kbx_di" bpmnElement="Activity_0cir5fq">
|
|
|
+ <dc:Bounds x="960" y="480" width="100" height="80" />
|
|
|
+ <bpmndi:BPMNLabel />
|
|
|
+ </bpmndi:BPMNShape>
|
|
|
+ <bpmndi:BPMNShape id="Activity_0n7x8km_di" bpmnElement="Activity_10ywpg4">
|
|
|
+ <dc:Bounds x="1190" y="240" width="100" height="80" />
|
|
|
+ <bpmndi:BPMNLabel />
|
|
|
+ </bpmndi:BPMNShape>
|
|
|
+ <bpmndi:BPMNShape id="Activity_0apwby6_di" bpmnElement="Activity_0c44yrz">
|
|
|
+ <dc:Bounds x="760" y="480" width="100" height="80" />
|
|
|
+ <bpmndi:BPMNLabel />
|
|
|
+ </bpmndi:BPMNShape>
|
|
|
<bpmndi:BPMNShape id="TextAnnotation_1vnw6c1_di" bpmnElement="TextAnnotation_1vnw6c1">
|
|
|
<dc:Bounds x="860" y="90" width="100" height="41" />
|
|
|
<bpmndi:BPMNLabel />
|
|
@@ -318,20 +523,20 @@ next();</bpmn2:script>
|
|
|
<di:waypoint x="730" y="345" />
|
|
|
<di:waypoint x="880" y="345" />
|
|
|
<di:waypoint x="880" y="280" />
|
|
|
- <di:waypoint x="900" y="280" />
|
|
|
+ <di:waypoint x="995" y="280" />
|
|
|
</bpmndi:BPMNEdge>
|
|
|
<bpmndi:BPMNEdge id="Flow_0zubkyw_di" bpmnElement="Flow_0zubkyw">
|
|
|
- <di:waypoint x="955" y="280" />
|
|
|
- <di:waypoint x="1032" y="280" />
|
|
|
+ <di:waypoint x="1045" y="280" />
|
|
|
+ <di:waypoint x="1122" y="280" />
|
|
|
<bpmndi:BPMNLabel>
|
|
|
- <dc:Bounds x="983" y="262" width="22" height="14" />
|
|
|
+ <dc:Bounds x="1073" y="262" width="22" height="14" />
|
|
|
</bpmndi:BPMNLabel>
|
|
|
</bpmndi:BPMNEdge>
|
|
|
<bpmndi:BPMNEdge id="Flow_0nwaga3_di" bpmnElement="Flow_0nwaga3">
|
|
|
- <di:waypoint x="930" y="305" />
|
|
|
- <di:waypoint x="930" y="442" />
|
|
|
+ <di:waypoint x="1020" y="305" />
|
|
|
+ <di:waypoint x="1020" y="382" />
|
|
|
<bpmndi:BPMNLabel>
|
|
|
- <dc:Bounds x="934" y="342" width="22" height="14" />
|
|
|
+ <dc:Bounds x="1024" y="323" width="22" height="14" />
|
|
|
</bpmndi:BPMNLabel>
|
|
|
</bpmndi:BPMNEdge>
|
|
|
<bpmndi:BPMNEdge id="Flow_0bhibn0_di" bpmnElement="Flow_0bhibn0">
|
|
@@ -344,14 +549,14 @@ next();</bpmn2:script>
|
|
|
<di:waypoint x="662" y="670" />
|
|
|
</bpmndi:BPMNEdge>
|
|
|
<bpmndi:BPMNEdge id="Flow_02taytj_di" bpmnElement="Flow_02taytj">
|
|
|
- <di:waypoint x="1068" y="280" />
|
|
|
- <di:waypoint x="1132" y="280" />
|
|
|
+ <di:waypoint x="1158" y="280" />
|
|
|
+ <di:waypoint x="1190" y="280" />
|
|
|
</bpmndi:BPMNEdge>
|
|
|
<bpmndi:BPMNEdge id="Flow_1ucg773_di" bpmnElement="Flow_1ucg773">
|
|
|
<di:waypoint x="500" y="612" />
|
|
|
<di:waypoint x="500" y="590" />
|
|
|
- <di:waypoint x="1150" y="590" />
|
|
|
- <di:waypoint x="1150" y="298" />
|
|
|
+ <di:waypoint x="1370" y="590" />
|
|
|
+ <di:waypoint x="1370" y="298" />
|
|
|
</bpmndi:BPMNEdge>
|
|
|
<bpmndi:BPMNEdge id="Flow_1t45qnv_di" bpmnElement="Flow_1t45qnv">
|
|
|
<di:waypoint x="510" y="460" />
|
|
@@ -365,18 +570,13 @@ next();</bpmn2:script>
|
|
|
<di:waypoint x="560" y="500" />
|
|
|
</bpmndi:BPMNEdge>
|
|
|
<bpmndi:BPMNEdge id="Flow_06cxzjx_di" bpmnElement="Flow_06cxzjx">
|
|
|
- <di:waypoint x="930" y="478" />
|
|
|
- <di:waypoint x="930" y="500" />
|
|
|
- <di:waypoint x="900" y="500" />
|
|
|
+ <di:waypoint x="1020" y="418" />
|
|
|
+ <di:waypoint x="1020" y="480" />
|
|
|
</bpmndi:BPMNEdge>
|
|
|
<bpmndi:BPMNEdge id="Flow_0gyvyyo_di" bpmnElement="Flow_0gyvyyo">
|
|
|
<di:waypoint x="330" y="280" />
|
|
|
<di:waypoint x="380" y="280" />
|
|
|
</bpmndi:BPMNEdge>
|
|
|
- <bpmndi:BPMNEdge id="Flow_06kumr8_di" bpmnElement="Flow_06kumr8">
|
|
|
- <di:waypoint x="800" y="520" />
|
|
|
- <di:waypoint x="560" y="520" />
|
|
|
- </bpmndi:BPMNEdge>
|
|
|
<bpmndi:BPMNEdge id="Flow_02nannf_di" bpmnElement="Flow_02nannf">
|
|
|
<di:waypoint x="550" y="305" />
|
|
|
<di:waypoint x="550" y="345" />
|
|
@@ -405,7 +605,19 @@ next();</bpmn2:script>
|
|
|
<di:waypoint x="860" y="210" />
|
|
|
<di:waypoint x="880" y="210" />
|
|
|
<di:waypoint x="880" y="280" />
|
|
|
- <di:waypoint x="900" y="280" />
|
|
|
+ <di:waypoint x="995" y="280" />
|
|
|
+ </bpmndi:BPMNEdge>
|
|
|
+ <bpmndi:BPMNEdge id="Flow_09c65ah_di" bpmnElement="Flow_09c65ah">
|
|
|
+ <di:waypoint x="960" y="520" />
|
|
|
+ <di:waypoint x="860" y="520" />
|
|
|
+ </bpmndi:BPMNEdge>
|
|
|
+ <bpmndi:BPMNEdge id="Flow_1xp7bfo_di" bpmnElement="Flow_1xp7bfo">
|
|
|
+ <di:waypoint x="1290" y="280" />
|
|
|
+ <di:waypoint x="1352" y="280" />
|
|
|
+ </bpmndi:BPMNEdge>
|
|
|
+ <bpmndi:BPMNEdge id="Flow_1eauhgu_di" bpmnElement="Flow_1eauhgu">
|
|
|
+ <di:waypoint x="760" y="520" />
|
|
|
+ <di:waypoint x="560" y="520" />
|
|
|
</bpmndi:BPMNEdge>
|
|
|
<bpmndi:BPMNEdge id="Association_0p6rlsh_di" bpmnElement="Association_0p6rlsh">
|
|
|
<di:waypoint x="848" y="170" />
|