You may be troubled by this problem, because you need to get the value of the variables set in the process when you track the completed process (you can analyze the detailed status of each node), and today we'll explore how.
1.ACTIVITI Table Structure Design
The table structure design of Activiti is divided into two types: runtime (Act_ru), History (Act_hi).
1.1 Run-time variables
All runtime variables are stored in the table:act_ru_variable , which can be inserted into the database in the startup process, the completion of the task, and the dynamic addition, so that the process can determine the direction of the process based on the value of the variable in its processing.
1.2 What about historical variables?
Why not act_hi_variable this watch?
I was also troubled at the beginning. Why not have this table, resulting in the tracking of historical process information can not get variables.
2. Understanding Historical Levels
Activit provides a 4 history level by default:
None: The system performance can be improved by not saving any history records;
activity: Save all the process instances, tasks, activity information;
Audit: is also the default level of Activiti, saving all process instances, tasks, activities, form attributes;
Full: The most complete history, in addition to the information containing the audit level, can be saved in detail, for example: process variables.
For several levels, depending on the requirements of the feature, you can turn on full if you need to track details later.
3. Configure the history level3.1 Configuring in XML
Configuration in Engine beanprocessengineconfiguration :
?
3.2 Dynamic configuration?
4. Reading historical variables
Now restart your app, start the process or view the data for the act_hi_detail table after the task complete has been recorded.
4.1 Java code-before version 5.10?
1 2 3 4 5 6 |
list4.2 Java code-after version 5.11 Version 5.11 has been changed in terms of variable saving, creating a single table act_hi_varinst Save variables, you can read the variables in the code below. See also: Activiti 5.11 Release ?
1 2 3) 4 5 |
list5. Read Only form fields?
ACTIVITI Table Structure Explained |
|