KADAI-jobs
Jobs are automated processes that run in the background of the application, usually periodically. They are scheduled for configurable times and then run by the scheduler. For example, the TaskCleanupJob deletes Tasks after they reached a certain time passed after their completion. You can read more about jobs here. Common options for jobs customization are listed and explained as following:
- Batch size: Maximum number of entities that are processed in one job
- Max number of retries: Maximum number of retries if a job fails
- First run at: The date for the first run of the job
- Run every: The interval between individual runs of a job
Additionally, different jobs have other special parameters for customization which can be found below. There is an example job configuration and execution at the end of this article.
You can also configure the scheduler. The scheduler will initialize the first schedule for the jobs. Each run, the scheduler looks up which jobs are past their due date. These jobs get executed. The behavior of jobs and the scheduler in KADAI can be customized in the configuration file kadai.properties with the following parameters:
Scheduler Configuration
| Parameter | Description | Default Value |
|---|---|---|
kadai.jobs.scheduler.enabled | Enabling automated scheduling of jobs | true |
kadai.jobs.scheduler.initialStartDelay | Start delay before the first job gets scheduled | 100 |
kadai.jobs.scheduler.period | The time interval between the individual runs of the scheduler | 5 |
kadai.jobs.scheduler.periodTimeUnit | The unit for scheduler.initialStartDelay and scheduler.period | MINUTES |
General Jobs Configuration
These configuration options are overwritten by job-specific configuration options
| Parameter | Description | Default Value |
|---|---|---|
kadai.jobs.maxRetries | number of automatic retries after a job has failed | 3 |
kadai.jobs.batchSize | upper bound of how many tasks can be processed by one job | 100 |
kadai.jobs.runEvery | period of time between the executions of jobs (Duration in ISO 8601 format) | P1D |
kadai.jobs.firstRunAt | first time the job is run (DateTime n ISO 8601 format) | 2023-01-01T00:00:00Z |
kadai.jobs.lockExpirationPeriod | period of time the lock is valid (Duration in ISO 8601 format). Should be longer than the longest possible job execution time | P2D |
TaskCleanupJob Configuration
| Parameter | Description | Default Value |
|---|---|---|
kadai.jobs.cleanup.task.enable | Enabling automated cleanup of completed tasks after a period of time specified by job.runEvery | true |
kadai.jobs.cleanup.task.batchSize | upper bound of how many tasks can be processed in one TaskCleanupJob batch; overrides kadai.jobs.batchSize for this job | 5000 |
kadai.jobs.cleanup.task.minimumAge | Default completed-task age before cleanup may delete a task (Duration in ISO 8601 format) | P14D |
kadai.jobs.cleanup.task.minimumAgeByDomain.<DOMAIN> | Optional domain-specific completed-task age. Takes precedence over minimumAge for that domain (Duration in ISO 8601 format) | |
kadai.jobs.cleanup.task.allCompletedSameParentBusiness | Prevent deletion of tasks if other tasks with same parent business process ID are not yet completed | true |
kadai.jobs.cleanup.task.lockExpirationPeriod | period of time the lock is valid (Duration in ISO 8601 format). Should be longer than the longest possible job execution time | PT30M |
kadai.jobs.cleanup.task.minimumAge defaults to P14D. A configured
minimumAgeByDomain value takes precedence for its domain; domains without an override use the
default. The domain used in minimumAgeByDomain.<DOMAIN> must be declared in kadai.domains;
an override for an unknown domain is rejected. When allCompletedSameParentBusiness=true, cleanup
waits until every sibling sharing a parent business process ID has reached its own applicable
domain-specific duration.
kadai.domains=DOMAIN_A | DOMAIN_B
kadai.jobs.cleanup.task.minimumAge=P14D
kadai.jobs.cleanup.task.minimumAgeByDomain.DOMAIN_A=P7D
In this example, tasks in DOMAIN_A are eligible for cleanup after 7 days. Tasks in DOMAIN_B
use the default and are eligible after 14 days.
WorkbasketCleanupJob Configuration
| Parameter | Description | Default Value |
|---|---|---|
kadai.jobs.cleanup.workbasket.enable | Enable WorkbasketCleanupJob to cleanup completed workbaskets after a period of time if no pending tasks | true |
kadai.jobs.cleanup.workbasket.lockExpirationPeriod | period of time the lock is valid (Duration in ISO 8601 format). Should be longer than the longest possible job execution time | PT30M |
HistoryCleanupJob Configuration
| Parameter | Description | Default Value |
|---|---|---|
kadai.jobs.cleanup.history.simple.enable | Enables the HistoryCleanupJob to delete history events | false |
kadai.jobs.cleanup.history.simple.minimumAge | a history event may only be deleted by the cleanup after this period of time or later (Duration in ISO 8601 format) | P14D |
kadai.jobs.cleanup.history.simple.batchSize | upper bound of how many history events can be processed by one history cleanup job | 100 |
kadai.jobs.cleanup.history.simple.allCompletedSameParentBusiness | Prevent deletion of Task History Events if other Task History Events with same parent business process ID have types other than "CREATED" | true |
kadai.jobs.cleanup.history.simple.lockExpirationPeriod | period of time the lock is valid (Duration in ISO 8601 format). Should be longer than the longest possible job execution time | PT30M |
TaskUpdatePriorityJob Configuration
| Parameter | Description | Default Value |
|---|---|---|
kadai.jobs.priority.task.enable | Enabling automated recalculation of priority of each tasks that is not in an endstate | false |
kadai.jobs.priority.task.batchSize | upper bound of how many tasks can be processed by one TaskUpdatePriorityJob | 100 |
kadai.jobs.priority.task.runEvery | period of time between the executions of the TaskUpdatePriorityJob (Duration in ISO 8601 format) | P1D |
kadai.jobs.priority.task.firstRunAt | first time the job is executed (DateTime in ISO 8601 format) | 2023-01-01T00:00:00Z |
kadai.jobs.priority.task.lockExpirationPeriod | period of time the lock is valid (Duration in ISO 8601 format). Should be longer than the longest possible job execution time | PT30M |
UserInfoRefreshJob Configuration
| Parameter | Description | Default Value |
|---|---|---|
kadai.jobs.refresh.user.enable | Enable job to refresh all user info after a period of time | false |
kadai.jobs.refresh.user.batchSize | maximum number of user, group, and permission changes written to the database in one batch | 1000 |
kadai.jobs.refresh.user.runEvery | period of time between the executions of the UserInfoRefreshJob (Duration in ISO 8601 format) | P1D |
kadai.jobs.refresh.user.firstRunAt | first time the job is executed (DateTime in ISO 8601 format) | 2023-01-01T23:00:00Z |
kadai.jobs.refresh.user.lockExpirationPeriod | period of time the lock is valid (Duration in ISO 8601 format). Should be longer than the longest possible job execution time | PT30M |
CustomJobs Configuration
| Parameter | Description | Default Value |
|---|---|---|
kadai.jobs.customJobs | Initialize custom jobs by specifying path to job class |
Example
Setup:
kadai.jobs.scheduler.enabled=true
kadai.jobs.scheduler.initialStartDelay=2
kadai.jobs.scheduler.period=3
kadai.jobs.scheduler.periodTimeUnit=HOURS
kadai.jobs.refresh.user.firstRunAt=2017-04-05T18:00:00Z
kadai.jobs.refresh.user.runEvery=P4H
Result (assuming the refresh user job is the only active job):
