In order to satisfy data protection laws or just for general storage management purposes Optimize provides an automated cleanup functionality. The cleanup is performed based on process/decision instance data and the criteria to decide about whether an instance is to be cleaned up is based on it’s end date and the configured time to live period.
Please note the following:
- By default the history cleanup is disabled in Optimize. Before enabling it you should consider the type of cleanup and time to live period that fits to your needs. Otherwise historic data intended for analysis might get lost irreversibly.
- The default engine history cleanup works different than the one in Optimize due to the possible cleanup strategies. The current implementation in Optimize is equivalent to the
end timestrategy of the Engine.
The most crucial setting properties are
processDataCleanupMode, their global default configuration is the following:
historyCleanup: ttl: 'P2Y' processDataCleanupMode: 'all'
ttl - is the time to live period from which process/decision instances with an end date (or evaluationDate in case of decision instances) older than that period are picked up by the cleanup process.
The default value is
'P2Y', which means by default all instances older than 2 years at the point in time the cleanup is executed are cleaned up.
For details on the notation see the Configuration Description of the ttl property.
processDataCleanupMode - determines what is deleted when a process instance is cleaned. The default value of
'all' means the whole process instance is deleted.
For other options checkout the Configuration Description of the processDataCleanupMode property. Note that the previously described behavior doesn’t apply to decision instances since they will always be completely deleted.
To setup different
ttls or different cleanup
processDataCleanupModes you can also provide process specific settings using the
perProcessDefinitionConfig list and the process definition key.
historyCleanup: ttl: 'P2Y' processDataCleanupMode: 'all' perProcessDefinitionConfig: 'MyProcessDefinitionKey': ttl: 'P2M' processDataCleanupMode: 'variables'
These settings overwrite the global values, are thus optional and so you are able to just override one of them for a certain process. In this particular sample the cleanup on process instances of the key
'MyProcessDefinitionKey' would get cleaned up after 2 months instead of 2 years and on cleanup only their variables would get deleted instead of the whole instance.
For decision instances there is the
perDecisionDefinitionConfig list for specific
historyCleanup: ttl: 'P2Y' processDataCleanupMode: 'all' perDecisionDefinitionConfig: 'myDecisionDefinitionKey': ttl: 'P3M'
Another property you can set is the
cronTrigger which defines at what time the cleanup should run.
historyCleanup: cronTrigger: '0 1 * * *'
The default is 1AM every day. To avoid any impact on daily business it is recommended to schedule the cleanup outside of business hours. See the Configuration Description for further insights into this property and it’s format.
Once you have configured the history clean up, you can activate it with:
historyCleanup: enabled: true
Setting this property to
true ultimately enables the cleanup process to be run on the next cron trigger after a full restart of the Optimize application
Here is a sample of how a complete config might look like:
historyCleanup: enabled: true cronTrigger: '0 1 * * 0' ttl: 'P1Y' processDataCleanupMode: 'variables' perProcessDefinitionConfig: 'VeryConfidentProcess': ttl: 'P1M' processDataCleanupMode: 'all' 'KeepTwoMonthsProcess': ttl: 'P2M' perDecisionDefinitionConfig: 'myDecisionDefinitionKey': ttl: 'P3M'
In the following a brief summary is given of what presented configuration does:
- The cleanup is enabled.
- It is scheduled to run every sunday at 1AM.
- The global
ttlapplied to all process instances stored in Optimize is 1 year.
- The global cleanup
processDataCleanupModeperformed on all process instances that passed the
ttlperiod is to just clear their variables.
- There is a process specific setup for
'VeryConfidentProcess'that has a special
ttlof 1 month to be used for it’s process instances and those will be deleted completely due the
'all'processDataCleanupMode configured for them.
- There is another process specific setup for
'ToKeepForeverProcess'that has a special
ttlof 2 months.
- And finally there is a decision definition specific setup for
myDecisionDefinitionKeythat has a special
ttlof 3 months.