A Jahia 8.2 module that automatically cleans exited or completed workflow tasks (publication, etc.).
This is a maintenance release focused on WCAG 2.1 AA accessibility for the admin UI and hardening of the cleanup scheduler backend. No new features, no breaking changes; the GraphQL schema and module configuration surface are unchanged.
WorkflowTasksCleanerMutationExtension.javarunClean): replaced the non-atomic get() + set() pattern with AtomicBoolean.compareAndSet(false, true), closing the TOCTOU window where two concurrent invocations (manual GraphQL trigger + scheduler tick) could both start a cleanup pass.saveConfig): the submitted cronExpression is now validated via org.quartz.CronExpression.isValidExpression(...) before being persisted. Previously an admin could save a syntactically invalid schedule that would silently fail to activate at the next scheduler bind.Affected files:
src/javascript/WorkflowTasksCleaner/WorkflowTasksCleaner.jsxsrc/javascript/WorkflowTasksCleaner/SchedulerConfig.jsxsrc/javascript/WorkflowTasksCleaner/WorkflowTasksCleaner.scsssrc/main/resources/javascript/locales/en.json (new label.scheduler.configTitle)Critical fixes:
0.6875rem to 0.75rem to remain legible at the uppercase scale.role="status" + role="alert") in both panels. Removed the liveRef focus call that was moving focus to a visually hidden element.aria-label to aria-labelledby pointing to an existing on-screen heading, avoiding Moonstone child-forwarding ambiguity.Major fixes:
#595959 for table header, tooltip and restart-hint text (replaces var(--color-gray) whose Moonstone runtime value could fall below the 5.5:1 contrast threshold).#767676 for section and table-row borders (previous #dadada failed SC 1.4.11 non-text contrast at 1.47:1).SchedulerConfig document.title and <h2> now use label.scheduler.configTitle ("Scheduler Configuration") instead of a generic "Configuration"..wtc_container *:focus-visible policy added (2px accent outline) for keyboard focus visibility..wtc_label label font-size converted from 14px to 0.875rem (SC 1.4.4 — text resizing).Input now carries required + aria-required="true" (SC 3.3.2, 4.1.2).Input exposes aria-invalid and a conditional aria-describedby referencing wtc-cron-error on save failure (SC 3.3.1).Full Changelog: 2_0_0...2_0_1
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.