The Tasks cleaner module provides commands for managing tasks like scheduled publications that have been executed.
Tasks that have been successfully executed are marked as "resolved" and retained in the task workspace in your JCR repository. Resolved tasks can be marked as "archived" and will no longer be displaced in the Tasks app. "Archived" tasks can be marked as "removed".
Having many resolved tasks can affect:
the time to log in to Admincentral
the time to publish
It’s a good idea to periodically archive resolved tasks to prevent Admincentral performance from being adversely impacted.
This module is at the INCUBATOR level.
Installing with Maven
Maven is the easiest way to install the module. Add the following to your bundle:
The following commands are defined by the Tasks Cleaner module: cleanup-archiveTasks and cleanup-removeTasks.
The commands cleanup-archiveTasks and cleanup-removeTasks can be run:
as scheduled jobs with the Scheduler module
through the REST command endpoint
invoked by app actions
through the console of the Groovy app
Commands
All commands can be found in the cleanup catalog at /module/tasks-cleaner/commands/cleanup.
Command
Description
archiveTasks
Check resolved tasks and mark selected tasks as archived according to configurable criteria.
removeTasks
Check archived tasks and mark selected task as removed according to configurable criteria.
Table 1. Properties
Property
Description
noop
optional
Do a dry-run, do not modify any tasks and report the results to Magnolia logs.
Default is false.
maxTasks
optional
Sets the maximum number of tasks that will be modified in a run (defaults to 256). If the maximum number of tasks is reached, the command will stop. If set to -1, no limit is imposed and all selected tasks will be modified.
Default is 256.
voters
required
A voter set that will select tasks for modification (either archiving or removal). See the following section on the task voters available.
Task Voters
There are a number of task voters you can use to select tasks for archiving or removing by the archiveTasks and removeTasks commands.
TaskCreatedBeforeVoter
TaskCreatedBeforeVoter returns true if the task was created before a configured date, false otherwise.
A date. The voter will return true if the task was created before the date.
TaskCreatedSinceVoter
TaskCreatedSinceVoter returns true if the task was created before a configured interval (in milliseconds) from the current time, false otherwise.
For example, if the interval is set to 30 days (2592000000 converted to milliseconds), the voter will return true if the creation date is 30 days before the current time at execution.
A date. The voter will return true if the task was modified before the date.
TaskModifiedSinceVoter
TaskModifiedSinceVoter returns true if the task was modified before a configured interval (in milliseconds) from the current time, false otherwise.
For example, if the interval is set to 30 days (2592000000 converted to milliseconds), the voter will return true if the last modified date is 30 days before the current time at execution.