Cleanup Activiti process history in Identity Manager
This article is valid for Smart ID 20.11 and later.
This article describes the scheduled job that regularly cleans up the the process history of Activiti. Finished processes are automatically removed from the database to improve performance and save disk space.Ā This is used inĀ Smart ID Identity Manager.
Configure Activiti process cleanup
In system.properties, you set up:
a Cron expression stating when the job shall run, for example, every Friday at 11 pm
a "buffer time", stating after how many days a finished or inactive process shall be deleted
This is an example:
Example: system.properties settings
# Age of history entries in days, after which finished task should be deleted
activitiHistoryCleaner.daysAfterEndTime=30
# Age of history entries in days, after which inactive task
# (i.e. unfinished task, which are untouched for daysAfterEndTime days) should be deleted
activitiHistoryCleaner.daysOfInactivity=180
# Cron expression, when the cleanup task should run. Here every friday at 11 pm
activitiHistoryCleanerJobTrigger.cronExpression = 0 0 23 ? * FRI *
If these parameters are not set, then there are default values set in theĀ process_execution-beans.xml.
Logging
A log file namedĀ nexus_activiti_history_cleanup.logĀ is generated. It logs the history data that was deleted.
Used Activiti services
These Activiti services are used to perform the cleanup task:
HistoryService: Queries for finished process instances and deletes them
TaskService. Queries for inactive process instances
ManagementService: Queries for stuck process instances (asynchronous tasks, that have no retries left)
RuntimeService: Deletes process instances, which are returned by TaskService and ManagementService
Affected database tables
These are the affected database tables:
Database table | Description |
---|---|
ACT_HI_PROCINST
| For all processes that have been finished for X-days ((END_ACT_ID_ is not null) AND (END_TIME_ >= current date - X-days after finishing) |
ACT_GE_BYTEARRAY: | General files, that are related to the specific process |
ACT_RU_JOB | For all processes that will not run anymore and all related data.Ā ->Ā (RETRIES_ <= 0) |
ACT_RU_TASK | For all unfinished processes where no user interaction has occurred in X-days (daysOfInactivity property) |
Ā
Copyright 2024 Technology Nexus Secured Business Solutions AB. All rights reserved.
Contact Nexus | https://www.nexusgroup.com | Disclaimer | Terms & Conditions