A Jahia 8.2 module that automatically cleans exited or completed workflow tasks (publication, etc.).
The module exposes a GraphQL API under the WorkflowTasksCleanerQuery and WorkflowTasksCleanerMutations extensions.
workflowTasksCleanerConfigReturns the current scheduler configuration (cron expression).
query {
workflowTasksCleanerConfig {
cronExpression
isRunning
tasksScanned
tasksDeleted
tasksFixed
}
}
workflowTasksCleanerWorkflowListLists workflow tasks with optional state filter.
query {
workflowTasksCleanerWorkflowList(taskState: ESCALATED) {
taskId
taskName
taskState
processId
processSubject
assignee
createdDate
dueDate
}
}
taskState values: PENDING, IN_PROGRESS, COMPLETED, CANCELLED, EXITED, ESCALATED, SUSPENDED, OBSOLETE
workflowTasksCleanerRunCleanTriggers an immediate cleanup of exited/completed tasks. Returns false if a clean is already running.
mutation {
workflowTasksCleanerRunClean
}
workflowTasksCleanerSaveConfigSaves a new cron expression for the scheduled job. A module restart is required for schedule changes to take effect.
mutation {
workflowTasksCleanerSaveConfig(cronExpression: "0 0 3 * * ?")
}
The module includes a React-based admin UI accessible via the Jahia tools:
workflow-cleaner:clean, workflow-cleaner:list, workflow-cleaner:taskworkflow-cleaner:listList all current workflow tasks with human-readable values for task states.
workflow-cleaner:taskOptions:
-id (required): The task id--fix: Try to fix the task (reassign groups/users)--delete: Delete the taskworkflow-cleaner:task -id 12345 --delete
MIT License
Copyright (c) 2022 - present Florent BOURASSÉ
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.