---
title: "审批集成 - 开发者中心 ODC V4.2.3 | OceanBase 文档中心"
description: 审批集成 背景信息 ODC V4.2.0 内置了审批流程，用于实现团队协同场景下的数据库安全管控。审批流程与风险等级绑定，即命中同一个风险等级的操作会触发同一个审批流程。 ODC V4.2.0 允许系统管理员（或者拥有外部集成管理权限的用户）配置外部审批系统集成。在编辑审批流程时您可以通过添加审批节点引用外部审批系统…
---
切换语言

- 中文站 - 简体中文
- International - English
- 日本站 - 日本語

文档反馈![](https://mdn.alipayobjects.com/huamei_22khvb/afts/img/A*lqS5SYzz_YEAAAAAAAAAAAAADiGDAQ/original) 开发者中心 ODCV 4.2.3

# 审批集成

更新时间：2026-04-13 15:31:14

[编辑](https://github.com/oceanbase/odc-doc/edit/V4.2.3/zh-CN/1000.system-integration/200.approval-integration.md)  

## 背景信息

ODC V4.2.0 内置了审批流程，用于实现团队协同场景下的数据库安全管控。审批流程与风险等级绑定，即命中同一个风险等级的操作会触发同一个审批流程。

ODC V4.2.0 允许系统管理员（或者拥有外部集成管理权限的用户）配置外部审批系统集成。在编辑审批流程时您可以通过添加审批节点引用外部审批系统集成，外部审批节点可以与 ODC 内置审批节点自由组合。

本文档旨在介绍如何配置和管理审批集成。

## 执行流程

![1](https://obbusiness-private.oss-cn-shanghai.aliyuncs.com/doc/img/odc/420/1500.system-integration/2.approval-integration/1.png)

1. ODC 系统管理员或者拥有外部集成管理权限的用户按照 ODC 提供的配置模板启用审批集成、设置访问外部审批系统的 request/response API 信息，创建外部审批集成。
 2. ODC 系统管理员在创建任务审批流程时，可以选择外部系统集成节点作为审批节点。
 3. ODC 系统管理员编辑风险等级时，选择创建的审批流程。
 4. ODC 成员发起任务工单时，如果审批任务流程节点的审批角色为外部系统集成，则会调用外部审批系统的 API 创建审批流程，并将其审批结果自动同步到 ODC 审批流程。

## 配置说明

### 配置方法

采用在线编辑 YAML 文件的方式配置审批集成。主要包括：

1. HTTP 连接参数。
 2. 新建流程、查询流程状态、终止流程的 API 信息。
 3. 加密参数。

支持的字段和说明如下：

| **一级参数名** | **二级参数名** | **三级参数名** | **四级参数名** | **类型** | **默认值** | **说明** |
| --- | --- | --- | --- | --- | --- | --- |
| http | connectTimeoutSeconds | - | - | Integer | 5 | HTTP 请求的连接超时时间，单位：秒 |
| http | socketTimeoutSeconds | - | - | Integer | 30 | HTTP 请求的 Socket 超时时间，单位：秒 |
| api | start（用于向 **外部审批系统** 发起 **新建审批工单** 请求） | method | - | Enum | POST | HTTP 请求方法，支持的枚举值：GET \| POST \| PUT \| PATCH |
| api | start（用于向 **外部审批系统** 发起 **新建审批工单** 请求） | url | - | String | <NULL> | HTTP 请求地址 |
| api | start（用于向 **外部审批系统** 发起 **新建审批工单** 请求） | headers | - | Map<String, String> | <NULL> | HTTP 请求头 |
| api | start（用于向 **外部审批系统** 发起 **新建审批工单** 请求） | queryParameters | - | Map<String, String> | <NULL> | HTTP 请求参数 |
| api | start（用于向 **外部审批系统** 发起 **新建审批工单** 请求） | body | type | ENUM | <NULL> | HTTP 请求体的格式，支持的枚举值：FORM_DATA \| RAW |
| api | start（用于向 **外部审批系统** 发起 **新建审批工单** 请求） | body | content | Object | <NULL> | HTTP 请求体的内容 |
| api | start（用于向 **外部审批系统** 发起 **新建审批工单** 请求） | requestEncrypted | - | Boolean | false | HTTP 请求体是否加密 |
| api | start（用于向 **外部审批系统** 发起 **新建审批工单** 请求） | requestSuccessExpression | - | String | <NULL> | 根据响应体解析判断请求是否执行成功的表达式，采用 SPEL 语法规范 |
| api | start（用于向 **外部审批系统** 发起 **新建审批工单** 请求） | extractInstanceIdExpression | - | String | <NULL> | 根据响应体解析外部审批系统流程 ID 的表达式，采用 SPEL 语法规范 |
| api | status（用于向 **外部审批系统** 发起 **查询审批状态** 请求） | method | - | Enum | POST | HTTP 请求方法，支持的枚举值：GET \| POST \| PUT \| PATCH |
| api | status（用于向 **外部审批系统** 发起 **查询审批状态** 请求） | url | - | String | <NULL> | HTTP 请求地址 |
| api | status（用于向 **外部审批系统** 发起 **查询审批状态** 请求） | headers | - | Map<String, String> | <NULL> | HTTP 请求头 |
| api | status（用于向 **外部审批系统** 发起 **查询审批状态** 请求） | queryParameters | - | Map<String, String> | <NULL> | HTTP 请求参数 |
| api | status（用于向 **外部审批系统** 发起 **查询审批状态** 请求） | body | type | ENUM | <NULL> | HTTP 请求体的格式，支持的枚举值：FORM_DATA |
| api | status（用于向 **外部审批系统** 发起 **查询审批状态** 请求） | body | content | Object | <NULL> | HTTP 请求体的内容 |
| api | status（用于向 **外部审批系统** 发起 **查询审批状态** 请求） | requestEncrypted | - | Boolean | false | HTTP 请求体是否加密 |
| api | status（用于向 **外部审批系统** 发起 **查询审批状态** 请求） | requestSuccessExpression | - | String | <NULL> | 根据响应体解析判断请求是否执行成功的表达式，采用 SPEL 语法规范 |
| api | status（用于向 **外部审批系统** 发起 **查询审批状态** 请求） | processPendingExpression | - | String | <NULL> | 根据响应体解析判断审批工单在等待审批中的表达式，采用 SPEL 语法规范 |
| api | status（用于向 **外部审批系统** 发起 **查询审批状态** 请求） | processApprovedExpression | - | String | <NULL> | 根据响应体解析判断审批工单审批通过的表达式，采用 SPEL 语法规范 |
| api | status（用于向 **外部审批系统** 发起 **查询审批状态** 请求） | processRejectedExpression | - | String | <NULL> | 根据响应体解析判断审批工单审批拒绝的表达式，采用 SPEL 语法规范 |
| api | status（用于向 **外部审批系统** 发起 **查询审批状态** 请求） | processTerminatedExpression | - | String | <NULL> | 根据响应体解析判断审批工单已终止的表达式，采用 SPEL 语法规范 |
| api | status（用于向 **外部审批系统** 发起 **查询审批状态** 请求） | responseEncrypted | - | Boolean | false | HTTP 响应体是否加密 |
| api | cancel（用于向 **外部审批系统** 发起 **取消审批工单** 请求） | method | - | Enum | POST | HTTP 请求方法，支持的枚举值：GET \| POST \| PUT \| PATCH |
| api | cancel（用于向 **外部审批系统** 发起 **取消审批工单** 请求） | url | - | String | <NULL> | HTTP 请求地址 |
| api | cancel（用于向 **外部审批系统** 发起 **取消审批工单** 请求） | headers | - | Map<String, String> | <NULL> | HTTP 请求头 |
| api | cancel（用于向 **外部审批系统** 发起 **取消审批工单** 请求） | queryParameters | - | Map<String, String> | <NULL> | HTTP 请求参数 |
| api | cancel（用于向 **外部审批系统** 发起 **取消审批工单** 请求） | body | type | ENUM | <NULL> | HTTP 请求体的格式，支持的枚举值：FORM_DATA |
| api | cancel（用于向 **外部审批系统** 发起 **取消审批工单** 请求） | body | content | Object | <NULL> | HTTP 请求体的内容 |
| api | cancel（用于向 **外部审批系统** 发起 **取消审批工单** 请求） | requestEncrypted | - | Boolean | false | HTTP 请求体是否加密 |
| api | cancel（用于向 **外部审批系统** 发起 **取消审批工单** 请求） | requestSuccessExpression | - | String | <NULL> | 根据响应体解析判断请求是否执行成功的表达式，采用 SPEL 语法规范 |
| api | cancel（用于向 **外部审批系统** 发起 **取消审批工单** 请求） | responseEncrypted | - | Boolean | false | HTTP 响应体是否加密 |
| approvalTimeoutSeconds | - | - | - | Integer | 86400 | 审批超时时间，单位为秒。超过这个时间，ODC 将主动终止外部审批流程实例 |
| advanced | hyperlinkExpression | - | - | String | <NULL> | 用于构建跳转到外部审批系统，以查看工单详情的 URL 地址的表达式 |

### 模板变量

ODC 提供模板变量供用户输入配置参数时引用，引用方式：以 `${parameter_name}` 格式将模版变量拼接到 String 类型的参数中。

支持的模版变量与说明如下：

| **参数名** | **类型** | **生效范围** | **说明** |
| --- | --- | --- | --- |
| odc.site.url | String | 审批集成 | 外部访问 ODC 网站的地址，以 http/https 开始，包含 VIP 地址/域名/端口的网址，且结尾不包含斜杠（/），该变量值由用户配置到系统参数表中。 |
| process.instance.id | String | 审批集成（用于查询外部审批状态或取消外部审批） | 外部审批系统创建的流程实例 ID。 |
| task.type | String | 审批集成 | 任务类型。 |
| task.details | String | 审批集成 | 任务详情（内容为发起任务时的请求参数转换成的 JSON 字符串）。 |
| user.id | Long | 审批集成 | ODC 用户 ID。 |
| user.name | String | 审批集成 | ODC 用户名。 |
| user.account | String | 审批集成 | ODC 用户账户名。 |
| connection.name | String | 审批集成 | 所属数据源名称。 |
| connection.tenant | String | 审批集成 | 所属数据源的租户名。 |
| connection.properties.${key} | String | 审批集成 | 所属数据源的参数（创建连接时设置的 Map<String, String> 格式的参数，${key} 可以为连接参数 Map 中的任意一个 key）。 |
| sql.content | String | 审批集成（仅数据库变更任务有效） | 待检查的 SQL 内容。 |
| sql.content.json.array | String | 审批集成（仅数据库变更任务有效） | 待检查的 SQL 内容（按分隔符拆分成多个 SQL 语句后，以 JSON 数组格式组织）。 |

### 配置模板

```yaml
# This is a template for integrating a custom approval system.
# You must fill in all required fields according to the regulation to adapt to your approval system.

# Approval timeout in seconds
# ODC will actively terminate the external process instance if this time is exceeded
approvalTimeoutSeconds: 86400

# HTTP configurations
http:
  # HTTP connection timeout in second
  connectTimeoutSeconds: 5
  # HTTP socket timeout in second
  socketTimeoutSeconds: 30

# API configurations
api:
  # API configurations used to start a process instance
  start:
    # Request method, supported values: GET ｜ POST ｜ PUT ｜ PATCH
    method: ~
    # Request URI
    url: ~
    # Request headers, the format is: <key: value>
    headers:
      # Sample of headers
      Content-Type: application/json;charset=UTF-8
      Accept: application/json
    # Request query parameters, the format is: <key: value>
    queryParameters: ~
    # Request body
    body:
      # Type of request body, supported values: FORM_DATA | RAW
      type: RAW
      # Content of request body, the format is: <String> for RAW type or <key: value> for FORM_DATA type
      # Sample of request content in type of RAW
      content: |-
        {
          "userId": "${user.id}",
          "userName": "${user.name}",
          "taskType": "${task.type}",
          "connection": "${connection.name}",
          "tenant": "${connection.tenant}"
        }
    # Mark whether the request body is encrypted
    requestEncrypted: false
    # Expression to judge whether the request is successful based on the response body analysis, using the SPEL syntax
    requestSuccessExpression: '[success] == true'
    # Mark whether the response body is encrypted
    responseEncrypted: false
    # Expression to extract ID of process instance created by the external system based on the response body analysis, using the SPEL syntax
    extractInstanceIdExpression: '[content][processInstanceId]'
  # API configurations used to query the status of a process instance
  # Usage of the parameter with the same name is consistent with that described above
  status:
    method: ~
    url: ~
    headers: ~
    queryParameters: ~
    body:
      type: FORM_DATA
      # Sample of request content in type of FORM_DATA
      content:
        processInstanceId: ${process.instance.id}
        authKey: this-is-an-example
    requestEncrypted: false
    requestSuccessExpression: '[success] == true'
    responseEncrypted: false
    # Expression to judge that the process instance is waiting for approval based on the response body analysis, using the SPEL syntax
    processPendingExpression: '[content][processInstanceStatus] == "RUNNING"'
    # Expression to judge that the process instance is approved based on the response body analysis, using the SPEL syntax
    processApprovedExpression: '[content][outResult] == "APPROVED"'
    # Expression to judge that the process instance is rejected based on the response body analysis, using the SPEL syntax
    processRejectedExpression: '[content][outResult] == "REJECTED"'
    # Expression to judge that the process instance is terminated based on the response body analysis, using the SPEL syntax
    processTerminatedExpression: '[content][processInstanceStatus]=="TERMINATED"'
  # API configurations used to cancel a process instance
  # Usage of the parameter with the same name is consistent with that described above
  cancel:
    method: ~
    url: ~
    headers: ~
    queryParameters: ~
    body:
      type: RAW
      # Sample of request content in type of RAW
      content: |-
        {
          "processInstanceId": "${processInstanceId}"
        }
    requestEncrypted: false
    requestSuccessExpression: '[success] == true'
    responseEncrypted: false

# Advanced parameters
advanced:
  # Expression to build URL for jumping to external system to view ticket details
  hyperlinkExpression: http://localhost:5678/instanceDetails/?procInsId=${process.instance.id}

```

## 前提条件

系统管理员或者拥有外部集成管理权限的用户。

## 新建审批集成

1. 在项目协同窗口，单击 **外部集成** > **审批集成** > **新建审批集成**。

   ![2](https://obbusiness-private.oss-cn-shanghai.aliyuncs.com/doc/img/odc/420/1500.system-integration/2.approval-integration/2.png)
 2. 在弹出的 **新建审批集成** 面板中填写或选择以下信息。

   ![3](https://obbusiness-private.oss-cn-shanghai.aliyuncs.com/doc/img/odc/420/1500.system-integration/2.approval-integration/3.png)

   | 信息项 | 说明 |
   | --- | --- |
   | 审批集成名称 | 指定创建的审批集成名称。 |
   | 审批集成状态 | 选择启用/停用该审批集成。 |
   | 审批集成配置 | 编辑 YAML 文件的方式配置审批集成。具体配置方法请参见本文档中的 **配置说明**。 |
 3. 单击 **保存**，完成新建审批集成。
 4. 在审批集成列表中，可以启用/查看/编辑/删除审批集成。

   ![4](https://obbusiness-private.oss-cn-shanghai.aliyuncs.com/doc/img/odc/420/1500.system-integration/2.approval-integration/4.png)
 5. 编辑审批流程时引用创建的外部审批集成。

   ![5](https://obbusiness-private.oss-cn-shanghai.aliyuncs.com/doc/img/odc/420/1500.system-integration/2.approval-integration/5.png)

## 管理审批集成

在审批集成列表中，单击操作项下的 **查看**/**编辑**/**删除** 按钮，可以查看/编辑/删除审批集成信息。

![6](https://obbusiness-private.oss-cn-shanghai.aliyuncs.com/doc/img/odc/420/1500.system-integration/2.approval-integration/4.png)

## 相关文档

- [SQL 审核集成](https://www.oceanbase.com/docs/common-odc-1000000000468266)
 - [风险等级、风险识别规则与审批流程](https://www.oceanbase.com/docs/common-odc-1000000000468287)

 上一篇 下一篇 ![有帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*y6ocSqN8cqsAAAAAAAAAAAAAARQnAQ)![无帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*BG9IQJyLHF8AAAAAAAAAAAAAARQnAQ)![反馈](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*eTWdQKCRKHwAAAAAAAAAAAAAARQnAQ)[AI](https://www.oceanbase.com/obi) 咨询热线
