Database Tables in Activiti: The Foundation of Management Processes
About 528 wordsAbout 2 minDecember 3, 2024
Understanding the database tables and their relationships in Activiti is a crucial step to mastering the Activiti process engine. This article provides a detailed overview of the information stored in various tables in Activiti and their interrelations.
Overview of Activiti Database Tables
Activiti uses multiple database tables to store information about process definitions, process instances, tasks, historical data, and more. Here are some of the main tables and their functions:
1. ACT_RE_*
Series Tables (Repository Tables)
- ACT_RE_DEPLOYMENT: Stores deployment information. Each deployment of a process definition generates a record.
- ACT_RE_PROCDEF: Stores process definition information, including the process ID, name, version, etc.
2. ACT_RU_*
Series Tables (Runtime Tables)
- ACT_RU_EXECUTION: Stores runtime process instance information. Each process instance corresponds to a record.
- ACT_RU_TASK: Stores runtime task information, including the task ID, name, assignee, etc.
- ACT_RU_IDENTITYLINK: Stores the relationship information between tasks and users or groups.
- ACT_RU_VARIABLE: Stores runtime process variable information.
3. ACT_HI_*
Series Tables (History Tables)
- ACT_HI_PROCINST: Stores historical process instance information, recording completed process instances.
- ACT_HI_TASKINST: Stores historical task information, recording completed tasks.
- ACT_HI_VARINST: Stores historical process variable information.
Relationships Between Tables
1. Process Definition and Deployment
- The ACT_RE_DEPLOYMENT table and the ACT_RE_PROCDEF table are linked through the
DEPLOYMENT_ID_
column. One deployment can include multiple process definitions.
2. Process Instances and Tasks
- The ACT_RU_EXECUTION table and the ACT_RU_TASK table are linked through the
PROC_INST_ID_
column. One process instance can include multiple tasks. - The
EXECUTION_ID_
column in the ACT_RU_TASK table is linked to theID_
column in the ACT_RU_EXECUTION table, indicating which execution flow the task belongs to.
3. Tasks and Users/Groups
- The
TASK_ID_
column in the ACT_RU_IDENTITYLINK table is linked to theID_
column in the ACT_RU_TASK table, indicating the relationship between tasks and users or groups.
4. Runtime and Historical Data
- The
PROC_INST_ID_
column in the ACT_RU_EXECUTION table is linked to theID_
column in the ACT_HI_PROCINST table, recording both runtime and historical information of process instances. - The
ID_
column in the ACT_RU_TASK table is linked to theID_
column in the ACT_HI_TASKINST table, recording both runtime and historical information of tasks.