Tested in Alfresco 4.2.3 and RM 2.2
As you know, Alfresco has an events driven Retention and Disposition process, as part of the optional Records Management (RM) module.
There is a job executed that checks for the eligibility of any file to have a retention/disposition action automatically applied to it. If the action is manually applied before the job has a chance to run, there’s no harm done. But this job comes along behind and cleans up any missed files that are eligible for an action.
The actions that are available to be automatically executed are Retain, Cutoff, Destroy, Transfer and Accession.
The actions, however, that are actually configured to auto-occur out of the box are Cutoff and Retain. This means that if you want a file destroyed as soon as (or at least within 5 minutes in an out of the box configuration) it has become eligible for destruction, you have to do a little bit of configuration.
Now, this job (rm.dispositionlifecycletrigger) has regular schedule for execution – and the execution schedule is defined in <installdir>/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/module/org_alfresco_module_rm/alfresco-global.properties:
# # Global RM disposition lifecycle trigger cron job expression # rm.dispositionlifecycletrigger.cronexpression=0 0/5 * ?
This basically means that, out of the box, the job runs at every 5 minutes (a primer on cron expressions is available here).
If you want to change the frequency at which the job runs:
value into your <installdir>/tomcat/shared/classes/alfresco-global.properties file
rm.dispositionlifecycletrigger.cronexpression=0 0/15 * ?
To have the job run only every 15 minutes (at 0, 15, 20, 45 minutes past the hour), instead of every 5.
To change the actual retention/disposition Actions that are automatically applied to eligible files during the job:
- Do this in your Test environment only to start with and be aware of the consequences of enabling auto-Destroy…
- Copy tomcat/webapps/alfresco/WEB-INF/classes/alfresco/module/org_alfresco_module_rm/rm-job-context.xml to tomcat/shared/classes/alfresco/extension/rm-job-override-context.xml
- Edit the file to look as follows (colour added to assist with a later reference):
<?xml version='1.0' encoding='UTF-8’?> <!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'> <beans> <bean id=“dispositionLifecycleJobExecuter" class=“org.alfresco.module.org_alfresco_module_rm.job.DispositionLifecycleJobExecuter” parent="baseRMJobExecuter”> <!-- list of disposition actions to automatically execute when eligible —> <property name="dispositionActions"> <list> <value>cutoff</value> <value>retain</value> </list> </property> <property name="nodeService" ref="nodeService" /> <property name="searchService" ref="searchService" /> <property name="recordsManagementActionService" ref="recordsManagementActionService" /> </bean> </beans>
- Add the appropriate value keys to the dispositionActions <list> – e.g.:
<property name="dispositionActions"> <list> <value>cutoff</value> <value>retain</value> <value>destroy</value> </list> </property>
Legitimate values are: retain, cutoff, destroy, transfer, accession
- Save the file tomcat/shared/classes/alfresco/extension/rm-job-override-context.xml
- Restart the repository
- TEST TEST TEST
- Rollout in Production 🙂