审批流程信息回调

三方需要获取审批人信息、审批时间、批语等信息,可查看该文档

一、开放平台事件订阅使用

如果您不清楚如何使用开放平台事件订阅请先查看第一章节,如果已经熟悉,可直接看第二章节

事件订阅

二、事件订阅清单

ESN/approve

ESN的一般是老空间的或者部分三方对接表单; 一般情况下现在表单标品出来的都是approve的事件

ESN和approve不会有同时发送到事件, 一个流程要不是ESN的要不是approve的 可以两个都监听。 看实际情况,哪个监听到用哪个。

事件编码 事件名称 描述
bpm_task_ESN_create 任务创建 可以获取任务的开始时间,任务的处理人
bpm_task_ESN_complete 任务完成 可以获取任务的处理时间,处理人,批语
bpm_task_approve_create 表单approve任务创建 可以获取任务的开始时间,任务的处理人
bpm_task_approve_complete 表单approve任务完成 可以获取任务的处理时间,处理人,批语

三、 接收到的事件订阅

任务创建

execution 下

字段 描述
processInstanceId 流程实例ID,可以根据此实例ID判断是不是同一个流程
businessKey 由pkboins:pkbo拼接组成, pkboins为这条表单数据的id信息, pkbo是表单的主键,可以根据pkbo判断是哪个表单

查看task下数据信息

字段 描述
createTime 任务创建时间
name 活动环节名称
assignee 需要处理任务的处理人
id 任务id。 任务完成和任务创建的这个id是成对出现的。所以可以根据此id判断是否是同一个任务的开始或结束

{
    "eventType": "create",
    "sourceID": "bpm_task_approve",
    "userObject": {
        "useTextMessage": true,
        "isRejectAble": true,
        "execution": {
            "processDefinitionId": "iform_1c8558f8ac:1:545d5c99-c008-11ee-b269-567bb2c4974f",
            "processInstanceId": "5e1e76ce-c008-11ee-bb8a-eaeabb4cf56c",
            "currentActivityId": "approveUserTask_4a46e47ea1e74760bb4a96c33b739918",
            "tenantCode": "approve_x73db",
            "esnDocument": false,
            "deleteReason": null,
            "parentId": null,
            "businessActionCode": null,
            "startUserId": "0f059088-9c92-4769-a3e7-8f1a341cc3df",
            "appTenantId": "x73**mdb_approve",
            "currentActivityName": null,
            "businessKey": "917c1d763de9484098a27ba00481cc14:6128abaa9be7408db3a86bdf508c26ff",
            "isSendToAllUserIM": false,
            "name": "倪帅臣提交的testapprove1",
            "tenantId": "x73**mdb",
            "eventName": null,
            "startTime": 1706685266639,
            "endTime": null,
            "id": "5e1e76ce-c008-11ee-bb8a-eaeabb4cf56c",
            "appSource": "approve",
            "category": null,
            "isSendToStarterIM": true,
            "businessActionId": null,
            "superProcessInstanceId": null
        },
        "listenerType": "MqMessageSendAdapter",
        "eventCenterEventType": "create",
        "initiator": "0f059088-9c92-4769-a3e7-8f1a341cc3df",
        "language": "zh_CN",
        "initiatorOrg": "2257390646515456",
        "userId": "0f059088-9c92-4769-a3e7-8f1a341cc3df",
        "eventCenterEventSource": "bpm_task_approve",
        "currentTime": 1706685266793,
        "task": {
            "suspensionState": 1,
            "agent": null,
            "identityLinksInitialized": false,
            "parentTaskId": null,
            "dueDate": 33232058066787,
            "description": null,
            "createType": "start",
            "templateCode": null,
            "tenantCode": "approve_xx73**mdb",
            "locale": "zh_CN",
            "extVariables": {
                "delegateTask.deleteReason": "null",
                "historicTask.deleteReason": "null"
            },
            "approvalAction": "start",
            "delegationState": null,
            "originalOwner": null,
            "appTenantId": "x73**mdb_approve",
            "eventName": "create",
            "assigneeParticipant": null,
            "rejectToStartFakeTask": null,
            "id": "5e34e520-c008-11ee-bb8a-eaeabb4cf56c",
            "activityProperties": null,
            "copyToId": null,
            "owner": null,
            "processDefinitionId": "iform_1c8558f8ac:1:545d5c99-c008-11ee-b269-567bb2c4974f",
            "processInstanceId": "5e1e76ce-c008-11ee-bb8a-eaeabb4cf56c",
            "variables": null,
            "last": false,
            "formKey": null,
            "initialAssignee": null,
            "lastProcessInstanceId": null,
            "lastTaskDefinitionKey": null,
            "message": null,
            "priority": 50,
            "templateCodeChannelMap": null,
            "deleteReason": null,
            "revision": 1,
            "executionId": "5e33d3ac-c008-11ee-bb8a-eaeabb4cf56c",
            "lastTaskId": null,
            "taskDefinitionKey": "approveUserTask_4a46e47ea1e74760bb4a96c33b739918",
            "deleted": false,
            "lastProcessDefinitionId": null,
            "createTime": 1706685266786,
            "name": "活动1",
            "tenantId": "x73**mdb",
            "assignee": "0f059088-9c92-4769-a3e7-8f1a341cc3df",
            "appSource": "approve",
            "category": "9528fa3ddd7d41fd9ea88ba92ea8f95e",
            "first": true
        },
        "extSendObject": {
            "delegateTask.executionId": "5e33d3ac-c008-11ee-bb8a-eaeabb4cf56c",
            "delegateExecution.eventName": "null",
            "delegateTask.tenantId": "x73**mdb_approve",
            "delegateTask.id": "5e34e520-c008-11ee-bb8a-eaeabb4cf56c",
            "delegateTask.taskDefinitionKey": "approveUserTask_4a46e47ea1e74760bb4a96c33b739918",
            "delegateTask.processInstanceId": "5e1e76ce-c008-11ee-bb8a-eaeabb4cf56c",
            "delegateTask.eventName": "create",
            "delegateExecution.isNull": true,
            "delegateTask.isNull": false,
            "delegateTask.processDefinitionId": "iform_1c8558f8ac:1:545d5c99-c008-11ee-b269-567bb2c4974f",
            "delegateTask.createType": ""
        },
        "sendType": "ESN",
        "doneUser": "0f059088-9c92-4769-a3e7-8f1a341cc3df",
        "loginUserId": "0f059088-9c92-4769-a3e7-8f1a341cc3df",
        "initiatorDept": "2257393388769536",
        "ts": 1706685266864
    },
    "uuid": "7035ff2d-95a1-49da-a93c-29e1e3eb705e",
    "tenantCode": "x73**mdb"
}

任务完成

execution 下

字段 描述
processInstanceId 流程实例ID,可以根据此实例ID判断是不是同一个流程
businessKey 由pkboins:pkbo拼接组成, pkboins为这条表单数据的id信息, pkbo是表单的主键,可以根据pkbo判断是哪个表单

查看task下数据信息

先根据流程实例ID判断为同一流程,然后再根据id判断为同一环节,然后再根据assignee判断为同一审批人。 然后取出任务结束的createTime减去任务创建的createTime即为停留时间。

字段 描述
createTime 任务完成时间,
name 活动环节名称
assignee 需要处理任务的处理人
id 任务id。 任务完成和任务创建的这个id是成对出现的。所以可以根据此id判断是否是同一个任务的开始或结束

userObject数据信息下

字段 描述
msgComment 评语

{
    "eventType": "complete",
    "sourceID": "bpm_task_approve",
    "userObject": {
        "execution": {
            "processDefinitionId": "iform_1c8558f8ac:1:545d5c99-c008-11ee-b269-567bb2c4974f",
            "processInstanceId": "5e1e76ce-c008-11ee-bb8a-eaeabb4cf56c",
            "currentActivityId": "approveUserTask_4a46e47ea1e74760bb4a96c33b739918",
            "tenantCode": "approve_x73**mdb",
            "esnDocument": false,
            "deleteReason": null,
            "parentId": null,
            "businessActionCode": null,
            "startUserId": "0f059088-9c92-4769-a3e7-8f1a341cc3df",
            "appTenantId": "x73uqmdb_approve",
            "currentActivityName": null,
            "businessKey": "917c1d763de9484098a27ba00481cc14:6128abaa9be7408db3a86bdf508c26ff",
            "isSendToAllUserIM": false,
            "name": "倪帅臣提交的testapprove1",
            "tenantId": "x73uqmdb",
            "eventName": null,
            "startTime": 1706685266639,
            "endTime": null,
            "id": "5e1e76ce-c008-11ee-bb8a-eaeabb4cf56c",
            "appSource": "approve",
            "category": null,
            "isSendToStarterIM": true,
            "businessActionId": null,
            "superProcessInstanceId": null
        },
        "msgComment": "同意",
        "listenerType": "MqMessageSendAdapter",
        "eventCenterEventType": "complete",
        "initiator": "0f059088-9c92-4769-a3e7-8f1a341cc3df",
        "language": "zh_CN",
        "initiatorOrg": "2257390646515456",
        "userId": "0f059088-9c92-4769-a3e7-8f1a341cc3df",
        "eventCenterEventSource": "bpm_task_approve",
        "currentTime": 1706685774343,
        "task": {
            "suspensionState": 1,
            "agent": null,
            "identityLinksInitialized": false,
            "parentTaskId": null,
            "dueDate": 33232058067000,
            "description": "MqMessageSendAdapter",
            "createType": null,
            "templateCode": null,
            "tenantCode": "approve_x73uqmdb",
            "locale": "zh-CN",
            "extVariables": {
                "delegateTask.deleteReason": "null",
                "historicTask.deleteReason": "null"
            },
            "approvalAction": "complete",
            "delegationState": null,
            "originalOwner": null,
            "appTenantId": "x73**mdb_approve",
            "eventName": "complete",
            "assigneeParticipant": null,
            "rejectToStartFakeTask": null,
            "id": "5e34e520-c008-11ee-bb8a-eaeabb4cf56c",
            "activityProperties": null,
            "copyToId": null,
            "owner": null,
            "processDefinitionId": "iform_1c8558f8ac:1:545d5c99-c008-11ee-b269-567bb2c4974f",
            "processInstanceId": "5e1e76ce-c008-11ee-bb8a-eaeabb4cf56c",
            "variables": null,
            "last": false,
            "formKey": null,
            "initialAssignee": null,
            "lastProcessInstanceId": null,
            "lastTaskDefinitionKey": null,
            "message": null,
            "priority": 50,
            "templateCodeChannelMap": null,
            "deleteReason": null,
            "revision": 1,
            "executionId": "5e33d3ac-c008-11ee-bb8a-eaeabb4cf56c",
            "lastTaskId": null,
            "taskDefinitionKey": "approveUserTask_4a46e47ea1e74760bb4a96c33b739918",
            "deleted": false,
            "lastProcessDefinitionId": null,
            "createTime": 1706685267000,
            "name": "活动1",
            "tenantId": "x73**mdb",
            "assignee": "0f059088-9c92-4769-a3e7-8f1a341cc3df",
            "appSource": "approve",
            "category": "9528fa3ddd7d41fd9ea88ba92ea8f95e",
            "first": true
        },
        "extSendObject": {
            "delegateTask.executionId": "5e33d3ac-c008-11ee-bb8a-eaeabb4cf56c",
            "delegateExecution.eventName": "null",
            "delegateTask.tenantId": "x73**mdb_approve",
            "delegateTask.id": "5e34e520-c008-11ee-bb8a-eaeabb4cf56c",
            "delegateTask.taskDefinitionKey": "approveUserTask_4a46e47ea1e74760bb4a96c33b739918",
            "delegateTask.processInstanceId": "5e1e76ce-c008-11ee-bb8a-eaeabb4cf56c",
            "delegateTask.eventName": "complete",
            "delegateExecution.isNull": true,
            "delegateTask.isNull": false,
            "delegateTask.processDefinitionId": "iform_1c8558f8ac:1:545d5c99-c008-11ee-b269-567bb2c4974f"
        },
        "sendType": "ESN",
        "doneUser": "0f059088-9c92-4769-a3e7-8f1a341cc3df",
        "loginUserId": "0f059088-9c92-4769-a3e7-8f1a341cc3df",
        "initiatorDept": "2257393388769536",
        "ts": 1706685774394
    },
    "uuid": "72fd3b03-67c6-492b-8583-996a1e9540a5",
    "tenantCode": "x73**mdb"
}
Copyright © 用友 -【生态技术部】 2022-2023 all right reserved,powered by Gitbook修订时间: 2024-01-31 17:58:08

results matching ""

    No results matching ""