123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702 |
- <?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:startEvent id="event_start">
- <bpmn2:extensionElements>
- <camunda:properties>
- <camunda:property name="test" value="test111" />
- </camunda:properties>
- </bpmn2:extensionElements>
- <bpmn2:outgoing>Flow_15zn1tu</bpmn2:outgoing>
- </bpmn2:startEvent>
- <bpmn2:userTask id="task_request_task" name="提交审核" camunda:formKey="select_approve_type" camunda:assignee="owner">
- <bpmn2:extensionElements>
- <camunda:inputOutput>
- <camunda:inputParameter name="show_in_my_works">${false}</camunda:inputParameter>
- <camunda:inputParameter name="process_type">${1}</camunda:inputParameter>
- <camunda:inputParameter name="target_type">project-plan</camunda:inputParameter>
- <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" />
- <camunda:executionListener event="start">
- <camunda:script scriptFormat="JavaScript">
- (async function () {
- try {
- // 检查是否已配置了审核成员
- let handlers = await this.environment.services.get_handlers('task_checker');
- let outcome_count = await this.environment.services.get_outcome_count();
- this.environment.Logger('work').error(handlers);
- let result = handlers.length > 0 ? true: false;
- if (!result && outcome_count > 0) {
- return {
- result: false,
- message: '任务申请审核前,请先配置任务审核成员,否则无法执行审核任务。'
- }
- }
- // 检查需要审核的文档是否都已经上传
- let outcome_all_uploaded = await this.environment.services.check_all_outcome_uploaded();
- this.environment.Logger('work').error(outcome_all_uploaded);
- if (!outcome_all_uploaded) {
- return {
- result: false,
- message: '任务审核前,请确保此任务的所有交付物文档都已上传。'
- }
- }
- // 检查当前的项目状态是否允许提交任务审核
- let phase_id = await this.environment.services.get_prj_phase();
- switch(phase_id) {
- case 'doing':
- case 'reject_plan_alt':
- break;
- case 'apply_plan_alt':
- case 'review_plan_alt':
- return {
- result: false,
- message: '当前处于计划变更审核状态,不允许提交任务审核。'
- }
- case 'checking':
- return {
- result: false,
- message: '项目验收中,不允许提交任务审核。'
- }
- case 'deprecated':
- return {
- result: false,
- message: '项目已作废,不允许提交任务审核。'
- }
- case 'done':
- return {
- result: false,
- message: '项目已完成,不允许提交任务审核。'
- }
- default:
- return {
- result: false,
- message: '流程异常,当前项目状态下不允许提交任务审核。'
- }
- }
- return {
- result: true,
- message: 'OK'
- }
-
- } catch (e) {
- this.environment.Logger('work').error(e);
- return {
- result: false,
- message: 'fail'
- }
- }
- })();
-
- </camunda:script>
- </camunda:executionListener>
- </bpmn2:extensionElements>
- <bpmn2:incoming>Flow_1t45qnv</bpmn2:incoming>
- <bpmn2:incoming>Flow_0gyvyyo</bpmn2:incoming>
- <bpmn2:incoming>Flow_1gc46ur</bpmn2:incoming>
- <bpmn2:outgoing>Flow_1rg4oob</bpmn2:outgoing>
- <bpmn2:outgoing>Flow_0bhibn0</bpmn2:outgoing>
- </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>状态变为审核中(50)</bpmn2:documentation>
- <bpmn2:extensionElements>
- <camunda:properties>
- <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>
- <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_02nannf</bpmn2:incoming>
- <bpmn2:outgoing>Flow_193tusd</bpmn2:outgoing>
- <bpmn2:multiInstanceLoopCharacteristics isSequential="true" camunda:collection="${content.handlers}" camunda:elementVariable="handler">
- <bpmn2:loopCardinality xsi:type="bpmn2:tFormalExpression">${content.handlers.length}</bpmn2:loopCardinality>
- <bpmn2:completionCondition xsi:type="bpmn2:tFormalExpression">${!content.output.pass}</bpmn2:completionCondition>
- </bpmn2:multiInstanceLoopCharacteristics>
- </bpmn2:userTask>
- <bpmn2:exclusiveGateway id="gateway_approved" default="Flow_0nwaga3">
- <bpmn2:incoming>Flow_193tusd</bpmn2:incoming>
- <bpmn2:incoming>Flow_1rcwh5r</bpmn2:incoming>
- <bpmn2:outgoing>Flow_0zubkyw</bpmn2:outgoing>
- <bpmn2:outgoing>Flow_0nwaga3</bpmn2:outgoing>
- </bpmn2:exclusiveGateway>
- <bpmn2:sequenceFlow id="Flow_193tusd" sourceRef="task_approve_task_async" targetRef="gateway_approved" />
- <bpmn2:sequenceFlow id="Flow_0zubkyw" name="通过" sourceRef="gateway_approved" targetRef="event_throw_approved">
- <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>
- </bpmn2:sequenceFlow>
- <bpmn2:sequenceFlow id="Flow_0nwaga3" name="驳回" sourceRef="gateway_approved" targetRef="event_throw_approved_back">
- <bpmn2:documentation>审核不通过(30)</bpmn2:documentation>
- <bpmn2:extensionElements>
- <camunda:properties>
- <camunda:property name="task_status" value="30" />
- <camunda:property name="task_status_name" value="任务审核未通过" />
- </camunda:properties>
- </bpmn2:extensionElements>
- </bpmn2:sequenceFlow>
- <bpmn2:sequenceFlow id="Flow_0bhibn0" sourceRef="task_request_task" targetRef="task_with_draw_task" />
- <bpmn2:userTask id="task_with_draw_task" name="撤回申请" camunda:assignee="owner">
- <bpmn2:extensionElements>
- <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>
- </bpmn2:userTask>
- <bpmn2:sequenceFlow id="Flow_0tj9nd6" sourceRef="task_with_draw_task" targetRef="Event_throw_withdraw">
- <bpmn2:extensionElements>
- <camunda:properties>
- <camunda:property name="task_status" value="10" />
- </camunda:properties>
- </bpmn2:extensionElements>
- </bpmn2:sequenceFlow>
- <bpmn2:intermediateThrowEvent id="Event_throw_withdraw" name="撤回事件">
- <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="Activity_10ywpg4">
- <bpmn2:extensionElements />
- </bpmn2:sequenceFlow>
- <bpmn2:intermediateThrowEvent id="event_throw_approved" name="已审核事件">
- <bpmn2:incoming>Flow_0zubkyw</bpmn2:incoming>
- <bpmn2:outgoing>Flow_02taytj</bpmn2:outgoing>
- <bpmn2:signalEventDefinition id="SignalEventDefinition_07jfo4t" signalRef="Signal_0828f9d" />
- </bpmn2:intermediateThrowEvent>
- <bpmn2:sequenceFlow id="Flow_1ucg773" sourceRef="event_catch_approved" targetRef="Event_end" />
- <bpmn2:boundaryEvent id="event_catch_approved" name="已审核" attachedToRef="task_with_draw_task">
- <bpmn2:outgoing>Flow_1ucg773</bpmn2:outgoing>
- <bpmn2:signalEventDefinition id="SignalEventDefinition_02ri5rf" signalRef="Signal_0828f9d" />
- </bpmn2:boundaryEvent>
- <bpmn2:intermediateThrowEvent id="event_throw_approved_back" name="已审核事件">
- <bpmn2:incoming>Flow_0nwaga3</bpmn2:incoming>
- <bpmn2:outgoing>Flow_06cxzjx</bpmn2:outgoing>
- <bpmn2:signalEventDefinition id="SignalEventDefinition_0y27jk5" signalRef="Signal_0828f9d" />
- </bpmn2:intermediateThrowEvent>
- <bpmn2:sequenceFlow id="Flow_1t45qnv" sourceRef="task_modify_task1" targetRef="task_request_task" />
- <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_0cir5fq" />
- <bpmn2:manualTask id="task_do_task" name="实施任务工作">
- <bpmn2:incoming>Flow_15zn1tu</bpmn2:incoming>
- <bpmn2:outgoing>Flow_0gyvyyo</bpmn2:outgoing>
- </bpmn2:manualTask>
- <bpmn2:sequenceFlow id="Flow_0gyvyyo" sourceRef="task_do_task" targetRef="task_request_task">
- <bpmn2:extensionElements />
- </bpmn2:sequenceFlow>
- <bpmn2:manualTask id="task_modify_task1" name="修改交付物">
- <bpmn2:incoming>Flow_0nzbvpg</bpmn2:incoming>
- <bpmn2:incoming>Flow_1eauhgu</bpmn2:incoming>
- <bpmn2:outgoing>Flow_1t45qnv</bpmn2:outgoing>
- </bpmn2:manualTask>
- <bpmn2:endEvent id="Event_end">
- <bpmn2:incoming>Flow_1ucg773</bpmn2:incoming>
- <bpmn2:incoming>Flow_1xp7bfo</bpmn2:incoming>
- </bpmn2:endEvent>
- <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" />
- </bpmn2:boundaryEvent>
- <bpmn2:exclusiveGateway id="Gateway_1whgd2i" default="Flow_02nannf">
- <bpmn2:incoming>Flow_1rg4oob</bpmn2:incoming>
- <bpmn2:outgoing>Flow_02nannf</bpmn2:outgoing>
- <bpmn2:outgoing>Flow_0iv9g3p</bpmn2:outgoing>
- </bpmn2:exclusiveGateway>
- <bpmn2:sequenceFlow id="Flow_02nannf" sourceRef="Gateway_1whgd2i" targetRef="task_approve_task_async" />
- <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===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" />
- <bpmn2:boundaryEvent id="Event_1gpzq6w" name="撤回" attachedToRef="task_approve_task_sync">
- <bpmn2:outgoing>Flow_0b7s3zy</bpmn2:outgoing>
- <bpmn2:signalEventDefinition id="SignalEventDefinition_0z0tno6" signalRef="Signal_0hhmd7l" />
- </bpmn2:boundaryEvent>
- <bpmn2:sequenceFlow id="Flow_1gc46ur" sourceRef="task_modify_task2" targetRef="task_request_task" />
- <bpmn2:manualTask id="task_modify_task2" name="修改交付物">
- <bpmn2:incoming>Flow_0b7s3zy</bpmn2:incoming>
- <bpmn2:outgoing>Flow_1gc46ur</bpmn2:outgoing>
- </bpmn2:manualTask>
- <bpmn2:sequenceFlow id="Flow_1rcwh5r" sourceRef="Activity_0gfds7w" targetRef="gateway_approved" />
- <bpmn2:scriptTask id="Activity_0gfds7w" name="计算审核结果" scriptFormat="JavaScript">
- <bpmn2:incoming>Flow_1su3b3p</bpmn2:incoming>
- <bpmn2:outgoing>Flow_1rcwh5r</bpmn2:outgoing>
- <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++) {
- var value = this.environment.output.task_approve_task_sync[i];
- if (value && !value.pass) {
- passed = false;
- break;
- }
- }
- this.environment.variables.pass = passed;
- } 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>
- </bpmn2:textAnnotation>
- <bpmn2:association id="Association_0p6rlsh" sourceRef="Activity_0gfds7w" targetRef="TextAnnotation_1vnw6c1" />
- </bpmn2:process>
- <bpmn2:signal id="Signal_0hhmd7l" name="cancel_sign" />
- <bpmn2:message id="Message_0fh9t3e" name="msg_cancel" />
- <bpmn2:message id="Message_1qtzp8g" name="Message_0q7qbc4" />
- <bpmn2:signal id="Signal_0828f9d" name="Signal_2sf6vik" />
- <bpmndi:BPMNDiagram id="BPMNDiagram_1">
- <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="ProcessOutcomeApprove">
- <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="event_start">
- <dc:Bounds x="152" y="262" width="36" height="36" />
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="Activity_09wmdbt_di" bpmnElement="task_request_task">
- <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="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" />
- <bpmndi:BPMNLabel />
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="Event_0mceau4_di" bpmnElement="Event_throw_withdraw">
- <dc:Bounds x="662" y="652" width="36" height="36" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="658" y="695" width="44" height="14" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="Event_0tntlum_di" bpmnElement="event_throw_approved">
- <dc:Bounds x="1122" y="262" width="36" height="36" />
- <bpmndi:BPMNLabel>
- <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="1002" y="382" width="36" height="36" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="1042" y="393" width="55" height="14" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="Activity_0isolrc_di" bpmnElement="task_do_task">
- <dc:Bounds x="230" y="240" width="100" height="80" />
- <bpmndi:BPMNLabel />
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="Activity_1k7kq2t_di" bpmnElement="task_modify_task1">
- <dc:Bounds x="460" y="460" width="100" height="80" />
- <bpmndi:BPMNLabel />
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="Event_1jljt88_di" bpmnElement="Event_end">
- <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_09ebfre_di" bpmnElement="task_modify_task2">
- <dc:Bounds x="480" y="80" width="100" height="80" />
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="Activity_0ehtgyf_di" bpmnElement="Activity_0gfds7w">
- <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 />
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="Event_0x0on6p_di" bpmnElement="Event_1gpzq6w">
- <dc:Bounds x="682" y="152" width="36" height="36" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="719" y="153" width="22" height="14" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="Event_0s1xb2l_di" bpmnElement="Event_catch_withdraw">
- <dc:Bounds x="692" y="367" width="36" height="36" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="719" y="403" width="22" height="14" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="Event_06bs6js_di" bpmnElement="event_catch_approved">
- <dc:Bounds x="482" y="612" width="36" height="36" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="513" y="606" width="33" height="14" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="Flow_15zn1tu_di" bpmnElement="Flow_15zn1tu">
- <di:waypoint x="188" y="280" />
- <di:waypoint x="230" y="280" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="Flow_1rg4oob_di" bpmnElement="Flow_1rg4oob">
- <di:waypoint x="480" y="280" />
- <di:waypoint x="525" y="280" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="Flow_193tusd_di" bpmnElement="Flow_193tusd">
- <di:waypoint x="730" y="345" />
- <di:waypoint x="880" y="345" />
- <di:waypoint x="880" y="280" />
- <di:waypoint x="995" y="280" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="Flow_0zubkyw_di" bpmnElement="Flow_0zubkyw">
- <di:waypoint x="1045" y="280" />
- <di:waypoint x="1122" y="280" />
- <bpmndi:BPMNLabel>
- <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="1020" y="305" />
- <di:waypoint x="1020" y="382" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="1024" y="323" width="22" height="14" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="Flow_0bhibn0_di" bpmnElement="Flow_0bhibn0">
- <di:waypoint x="430" y="320" />
- <di:waypoint x="430" y="670" />
- <di:waypoint x="450" y="670" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="Flow_0tj9nd6_di" bpmnElement="Flow_0tj9nd6">
- <di:waypoint x="550" y="670" />
- <di:waypoint x="662" y="670" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="Flow_02taytj_di" bpmnElement="Flow_02taytj">
- <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="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" />
- <di:waypoint x="510" y="345" />
- <di:waypoint x="450" y="345" />
- <di:waypoint x="450" y="320" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="Flow_0nzbvpg_di" bpmnElement="Flow_0nzbvpg">
- <di:waypoint x="710" y="403" />
- <di:waypoint x="710" y="500" />
- <di:waypoint x="560" y="500" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="Flow_06cxzjx_di" bpmnElement="Flow_06cxzjx">
- <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_02nannf_di" bpmnElement="Flow_02nannf">
- <di:waypoint x="550" y="305" />
- <di:waypoint x="550" y="345" />
- <di:waypoint x="630" y="345" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="Flow_0iv9g3p_di" bpmnElement="Flow_0iv9g3p">
- <di:waypoint x="550" y="255" />
- <di:waypoint x="550" y="210" />
- <di:waypoint x="630" y="210" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="Flow_1su3b3p_di" bpmnElement="Flow_1su3b3p">
- <di:waypoint x="730" y="210" />
- <di:waypoint x="760" y="210" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="Flow_0b7s3zy_di" bpmnElement="Flow_0b7s3zy">
- <di:waypoint x="700" y="152" />
- <di:waypoint x="700" y="120" />
- <di:waypoint x="580" y="120" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="Flow_1gc46ur_di" bpmnElement="Flow_1gc46ur">
- <di:waypoint x="480" y="120" />
- <di:waypoint x="430" y="120" />
- <di:waypoint x="430" y="240" />
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="Flow_1rcwh5r_di" bpmnElement="Flow_1rcwh5r">
- <di:waypoint x="860" y="210" />
- <di:waypoint x="880" y="210" />
- <di:waypoint x="880" 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" />
- <di:waypoint x="885" y="131" />
- </bpmndi:BPMNEdge>
- </bpmndi:BPMNPlane>
- </bpmndi:BPMNDiagram>
- </bpmn2:definitions>
|