Camunda 数据库结构

流程引擎的数据库模式由多个表组成。 表名均以ACT开头。 第二部分是表用例的双字符标识。 此用例也将大致匹配服务 API。

  • ACT_RE_*:RE 代表存储库。 带有此前缀的表包含“静态”信息,例如流程定义和流程资源(图像、规则等)。
  • ACT_RU_*:RU 代表运行时。 这些是运行时表,包含流程实例、用户任务、变量、作业等的运行时数据。引擎仅在流程实例执行期间存储运行时数据,并在流程实例结束时删除记录。 这使得运行时表小而快。

  • ACT_ID_*:ID代表身份。 这些表包含身份信息,例如用户、组等。

  • ACT_HI_*:HI代表历史。 这些表包含历史数据,例如过去的流程实例、变量、任务等。
  • ACT_GE_*:通用数据,用于各种用例。

流程引擎的主表是流程定义、执行、任务、变量和事件订阅的实体。 它们的关系如下面的UML模型所示。 UML模型

Process Definitions (ACT_RE_PROCDEF) 流程定义表

The ACT_RE_PROCDEF table contains all deployed process definitions. It includes information like the version details, the resource name or the suspension state.

ACT_RE_PROCDEF 表包含所有已部署的流程定义。 它包括版本详细信息、资源名称或暂停状态等信息。

Executions (ACT_RU_EXECUTION) 流程执行表

The ACT_RU_EXECUTION table contains all current executions. It includes information like the process definition, parent execution, business key, the current activity and different metadata about the state of the execution.

ACT_RU_EXECUTION 表包含所有当前执行。 它包括流程定义、父执行、业务密钥、当前活动以及有关执行状态的不同元数据等信息。

Tasks (ACT_RU_TASK) 任务执行表

The ACT_RU_TASK table contains all open tasks of all running process instances. It includes information like the corresponding process instance, execution and also metadata such as creation time, assignee or due date.

ACT_RU_TASK 表包含所有正在运行的流程实例的所有打开的任务。 它包括相应的流程实例、执行等信息以及创建时间、受让人或到期日期等元数据。

Variables (ACT_RU_VARIABLE) 执行变量表

The ACT_RU_VARIABLE table contains all currently set process or task variables. It includes the names, types and values of the variables and information about the corresponding process instance or task.

ACT_RU_VARIABLE 表包含所有当前设置的流程或任务变量。 它包括变量的名称、类型和值以及相应流程实例或任务的信息。

Event Subscriptions (ACT_RU_EVENT_SUBSCR) 事件订阅表

The ACT_RU_EVENT_SUBSCR table contains all currently existing event subscriptions. It includes the type, name and configuration of the expected event along with information about the corresponding process instance and execution.

ACT_RU_EVENT_SUBSCR 表包含所有当前存在的事件订阅。 它包括预期事件的类型、名称和配置以及有关相应流程实例和执行的信息。

Schema Log (ACT_GE_SCHEMA_LOG) 历史记录表

The ACT_GE_SCHEMA_LOG table contains a history of the database schema version. New entries to the table are written when changes to the database schema are made. On database creation the initial entry is added. Every update script adds a new entry containing an id, the version the database was updated to and the date and time (timestamp) of the update.

ACT_GE_SCHEMA_LOG 表包含数据库架构版本的历史记录。 当数据库模式发生更改时,新条目将写入表中。 创建数据库时会添加初始条目。 每个更新脚本都会添加一个新条目,其中包含 ID、数据库更新到的版本以及更新的日期和时间(时间戳)。

To retrieve entries from the schema log, the SchemaLogQuery-API can be used:

要从架构日志中检索条目,可以使用 SchemaLogQuery-API:

List<SchemaLogEntry> entries = managementService.createSchemaLogQuery().list();

Metrics Log (ACT_RU_METER_LOG) 执行指标计数表

The ACT_RU_METER_LOG table contains a collection of runtime metrics that can help draw conclusions about usage, load and performance of the Camunda Platform. Metrics are reported as numbers in the Java long range and count the occurrence of specific events. Please find detailed information about how metrics are collected in the Metrics User Guide.

ACT_RU_METER_LOG 表包含运行时指标的集合,可以帮助得出有关 Camunda 平台的使用情况、负载和性能的结论。 指标以 Java 长范围内的数字形式报告,并对特定事件的发生进行计数。 请在指标用户指南中查找有关如何收集指标的详细信息。

The default configuration of the MetricsReporter will create one row per metric in ACT_RU_METER_LOG every 15 minutes.

MetricsReporter 的默认配置将每 15 分钟在 ACT_RU_METER_LOG 中为每个指标创建一行。

Heads Up!

注意:

If you are an enterprise customer, your license agreement might require you to report some metrics annually. Please store root-process-instance-start, activity-instance-start, executed-decision-instances and executed-decision-elements metrics for at least 18 months until they were reported.

如果您是企业客户,您的许可协议可能要求您每年报告一些指标。 请将根流程实例启动、活动实例启动、执行决策实例和执行决策元素指标存储至少 18 个月,直至报告为止。

Task Metrics Log (ACT_RU_TASK_METER_LOG) 任务指标计数表

The ACT_RU_TASK_METER_LOG table contains a collection of task related metrics that can help draw conclusions about usage, load and performance of the BPM platform. Task metrics contain a pseudonymized and fixed-length value of task assignees and their time of appearance. Please find detailed information about how task metrics are collected in the Metrics User Guide.

ACT_RU_TASK_METER_LOG 表包含任务相关指标的集合,可以帮助得出有关 BPM 平台的使用情况、负载和性能的结论。 任务指标包含任务受让人及其出现时间的匿名且固定长度的值。 请在《指标用户指南》中查找有关如何收集任务指标的详细信息。

Every assignment of a task to an assignee will create one row in ACT_RU_TASK_METER_LOG.

每次将任务分配给受让人都会在 ACT_RU_TASK_METER_LOG 中创建一行。

Heads Up!

注意:

If you are an enterprise customer, your license agreement might require you to report some metrics annually. Please store task metrics for at least 18 months until they were reported.

如果您是企业客户,您的许可协议可能要求您每年报告一些指标。 请将任务指标存储至少 18 个月,直到报告为止。

Entity Relationship Diagrams

The database is not part of the public API. The database schema may change for MINOR and MAJOR version updates.

该数据库不是公共 API 的一部分。 数据库架构可能会因次要和主要版本更新而更改。

Please note: The following diagrams are based on the MySQL database schema. For other databases the diagram may be slightly different.

请注意:下图基于 MySQL 数据库架构。 对于其他数据库,图表可能略有不同。

The following Entity Relationship Diagrams visualize the database tables and their explicit foreign key constraints, grouped by Engine with focus on BPMN, Engine with focus on DMN, Engine with focus on CMMN, the Engine History and the Identity. Please note that the diagrams do not visualize implicit connections between the tables.

以下实体关系图可视化数据库表及其显式外键约束,按以 BPMN 为重点的引擎、以 DMN 为重点的引擎、以 CMMN 为重点的引擎、引擎历史记录和身份进行分组。 请注意,这些图表并未可视化表之间的隐式连接。

Engine BPMN

实体关系图

Engine DMN

实体关系图

Engine CMMN

实体关系图

History

实体关系图

Identity

实体关系图