Most of the fields in the scheduler are pretty self-explanitory. When you click Save, the scheduler will be scheduled on the cron schedule you specify and will purge workflows older than the specified number of days using the configuration you specify.
This is all well and good, but let’s just say you wanted to just deploy a configuration as a part of your package deployment process. Through the magic of Apache Sling’s OSGi Configurations, you can do this with a simple XML file.
Simply create an XML file in your IDE in your content project under a path like:
/apps/[my-app]/config
Set the name of the file to:
com.adobe.granite.workflow.purge.Scheduler-com.adobe.granite.workflow.purge.Scheduler.config.[some-arbitrary-id].xml
and put in the following contents, replacing with the values for your configuration:
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" jcr:primaryType="sling:OsgiConfig"
scheduledpurge.name="Purge All Completed Workflows"
scheduledpurge.workflowStatus="COMPLETED"
scheduledpurge.modelIds="[]"
scheduledpurge.cron="0 0 * * * ?"
scheduledpurge.daysold="30" />
Once you deploy this file as part of your content package, you should see the configuration show up under the Workflow Purge Scheduler in the OSGi Configuration console.