OceanBase AI 数据大会
OceanBase
文档社区云控制台
登录免费试用
中国站 – 简体中文International – English日本 – 日本語
OceanBase
文档社区
免费试用
文档反馈
  1. 文档中心
  2. OceanBase 开发者中心
  3. V4.4.2
  4. 系统集成
  5. 审批集成
V4.4.2
  • 文档概览
  • 产品简介
  • 快速入门
  • 数据源管理
  • SQL 开发
  • 变更风险管控
  • 工单管理
  • 作业调度
  • 系统集成
    • 登录集成
    • 审批集成
    • SQL 审核集成
    • 堡垒机集成
    • 大模型集成
  • 部署指南
  • 升级指南
  • 最佳实践
  • 故障排查
  • 版本发布记录
  1. 文档中心
  2. OceanBase 开发者中心
  3. V4.4.2
  4. 系统集成
  5. 审批集成

审批集成

更新时间:2026-05-05 12:45:09

github-fill编辑
编组分享

背景信息

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

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

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

执行流程

1

  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 数组格式组织)。
database.owner.ids String 审批集成 数据库 owner 的用户 ID 列表,JSON 数组格式。
database.owner.accounts String 审批集成 数据库 owner 的用户账号名列表,JSON 数组格式。
database.owner.names String 审批集成 数据库 owner 的用户姓名列表,JSON 数组格式。
database.name String 审批集成 数据库名。
environment.name String 审批集成 环境名。
task.description String 审批集成 工单描述。
risk.level String 审批集成 风险等级。
project.owner.ids String 审批集成 项目 owner 的用户 ID 列表,JSON 数组格式。
project.owner.accounts String 审批集成 项目 owner 的用户账号名列表,JSON 数组格式。
project.owner.names String 审批集成 项目 owner 的用户姓名列表,JSON 数组格式。
odc.task.url String 审批集成 该工单的访问地址。

配置模板

# 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

  2. 在弹出的 新建审批集成 面板中填写或选择以下信息。

    3

    信息项 说明
    审批集成名称 指定创建的审批集成名称。
    审批集成状态 选择启用/停用该审批集成。
    审批集成配置 编辑 YAML 文件的方式配置审批集成。具体配置方法请参见本文档中的 配置说明。
  3. 单击 保存,完成新建审批集成。

  4. 在审批集成列表中,可以启用/查看/编辑/删除审批集成。

    4

  5. 编辑审批流程时引用创建的外部审批集成。

    5

管理审批集成

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

6

相关文档

  • SQL 审核集成

  • 风险管控

本文目录

背景信息执行流程配置说明配置方法模板变量配置模板前提条件新建审批集成管理审批集成相关文档
有帮助
无帮助
反馈

数据库

  • OceanBase 分布式数据库
  • OceanBase 集中式数据库

AI 数据平台

  • OceanLake AI 数据平台概览
  • OceanBase AI 数据库
  • OceanBase DataPilot
  • OceanBase Agentbase

配套工具

  • OAgent 运维智能体
  • OMA 迁移评估工具
  • OMS 数据迁移工具
  • OCP 运维管理工具
  • ODC 开发者工具
  • OAS 自治服务工具

资源

  • 文档
  • 社区
  • 软件下载
  • 认证与培训
  • 支持与服务

数据库百科

  • 数据库专题
  • 分布式数据库
  • 国产数据库
  • OLTP 数据库
  • OLAP 数据库
  • HTAP 数据库
  • 数据库
  • 向量数据库
  • 向量检索

关于我们

  • 关于 OceanBase
  • 公司新闻
  • 官方博客
  • 信任中心
  • 联系我们
  • 加入我们
电子营业执照京公网安备11010802047223号京ICP备20024574号-1合字B1.B2-20250395安全响应协议OceanBase 版权所有 ©