Interface JobManager
- All Known Implementing Classes:
DefaultJobManager
public interface JobManager
Contains methods that are not tied to any specific job type (async, timer, suspended or deadletter), but which are generally applicable or are about going from one type to another.
- Author:
- Tijs Rademakers, Joram Barrez
-
Method Summary
Modifier and TypeMethodDescriptionTransforms aSuspendedJobEntityback to anAbstractRuntimeJobEntity(i.e.voidbulkMoveTimerJobsToExecutableJobs(List<TimerJobEntity> timerJobEntities) Moves a collection ofTimerJobEntityinstances to become asyncJobEntityinstances (the timer is deleted and a new async job is inserted).copyJobInfo(AbstractRuntimeJobEntity copyToJob, AbstractRuntimeJobEntity copyFromJob) Copy job info from one job to the othervoidcreateAsyncJob(JobEntity jobEntity, boolean exclusive) Creates an async job so that it can be continued later in a background thread.createDeadLetterJobFromHistoryJob(HistoryJobEntity historyJobEntity) Create a dead letter job from a history job.Create a dead letter job from another jobCreate an executable job from another jobCreate an external worker job from another jobCreate a suspended job from another jobCreate a timer job from another jobvoidvoidExecute a job, which means that the logic (async logic, timer that fires, etc) is executed, typically by a background thread of an executor.getBusinessCalendarName(JobEntity timerEntity, VariableScope variableScope) Get the business calendar name of the job configurationmoveDeadLetterJobToExecutableJob(DeadLetterJobEntity deadLetterJobEntity, int retries) Transforms aDeadLetterJobEntityto aJob, thus making it executable again.moveDeadLetterJobToHistoryJob(DeadLetterJobEntity deadLetterJobEntity, int retries) Transforms aDeadLetterJobEntityto aHistoryJob, thus making it executable again (by the async history executor).moveExternalWorkerJobToExecutableJob(ExternalWorkerJobEntity externalWorkerJob) Moves anExternalWorkerJobEntityto become an asyncJobEntity.Transforms anAbstractRuntimeJobEntityto aDeadLetterJobEntity.Moves anAbstractRuntimeJobEntityto become aSuspendedJobEntity, such that theAsyncExecutorwon't pick it up anymore for execution.Moves anAbstractRuntimeJobEntityto become aTimerJobEntity.moveTimerJobToExecutableJob(TimerJobEntity timerJob) Moves aTimerJobEntityto become an asyncJobEntity.voidSchedules and async job.scheduleHistoryJob(HistoryJobEntity historyJobEntity, TransactionContext transactionContext) schedules aHistoryJobEntity, meaning it will be scheduled (inserted in the database/put on a queue/...) to be executed at a later point in time.voidscheduleTimerJob(TimerJobEntity timerJob) Schedules a timer, meaning it will be inserted in the datastore.voidsetJobServiceConfiguration(JobServiceConfiguration jobServiceConfiguration) The ProcessEngineConfiguration instance will be passed when the ProcessEngine is built.voidUnacquires a job, meaning that this job was previously locked, and it is now freed to be acquired by other executor nodes.voidunacquireWithDecrementRetries(JobInfo job, Throwable exception) Unacquires a job, meaning that this job was previously locked, and it is now freed to be acquired by other executor nodes.
-
Method Details
-
execute
Execute a job, which means that the logic (async logic, timer that fires, etc) is executed, typically by a background thread of an executor. -
unacquire
Unacquires a job, meaning that this job was previously locked, and it is now freed to be acquired by other executor nodes. -
unacquireWithDecrementRetries
Unacquires a job, meaning that this job was previously locked, and it is now freed to be acquired by other executor nodes. -
createAsyncJob
Creates an async job so that it can be continued later in a background thread. -
scheduleAsyncJob
Schedules and async job. If theAsyncExecutoris running, it can be executed immediately after the transaction. Otherwise it can be picked up by other executors. -
scheduleTimerJob
Schedules a timer, meaning it will be inserted in the datastore. -
getBusinessCalendarName
Get the business calendar name of the job configuration -
moveTimerJobToExecutableJob
Moves aTimerJobEntityto become an asyncJobEntity. This happens for example when the due date of a timer is reached, the timer entity then becomes a 'regular' async job that can be picked up by theAsyncExecutor. -
bulkMoveTimerJobsToExecutableJobs
Moves a collection ofTimerJobEntityinstances to become asyncJobEntityinstances (the timer is deleted and a new async job is inserted). Note that there are no revision checks happening on theTimerJobEntityinstances, this means this method should only be used when running with a global acquire lock. -
moveExternalWorkerJobToExecutableJob
Moves anExternalWorkerJobEntityto become an asyncJobEntity. This happens when the external worker has completed the work and the external work job then becomes a 'regular' async job that can be picked up by theAsyncExecutor. -
moveJobToTimerJob
Moves anAbstractRuntimeJobEntityto become aTimerJobEntity. This happens for example when an async job is executed and fails. It then becomes a timer, as it needs to be retried later. -
moveJobToSuspendedJob
Moves anAbstractRuntimeJobEntityto become aSuspendedJobEntity, such that theAsyncExecutorwon't pick it up anymore for execution. -
activateSuspendedJob
Transforms aSuspendedJobEntityback to anAbstractRuntimeJobEntity(i.e. to what it was originally). The job will now again be able to picked up by theAsyncExecutor. -
moveJobToDeadLetterJob
Transforms anAbstractRuntimeJobEntityto aDeadLetterJobEntity. This means that the job has been tried a configurable amount of times, but kept failing. -
moveDeadLetterJobToExecutableJob
Transforms aDeadLetterJobEntityto aJob, thus making it executable again. Note that a 'retries' parameter needs to be passed, as the job got into the deadletter table because of it failed and retries became 0. -
moveDeadLetterJobToHistoryJob
HistoryJobEntity moveDeadLetterJobToHistoryJob(DeadLetterJobEntity deadLetterJobEntity, int retries) Transforms aDeadLetterJobEntityto aHistoryJob, thus making it executable again (by the async history executor). Note that a 'retries' parameter needs to be passed, as the job got into the deadletter table because of it failed and retries became 0. -
deleteExecutableJob
-
scheduleHistoryJob
HistoryJobEntity scheduleHistoryJob(HistoryJobEntity historyJobEntity, TransactionContext transactionContext) schedules aHistoryJobEntity, meaning it will be scheduled (inserted in the database/put on a queue/...) to be executed at a later point in time. -
setJobServiceConfiguration
The ProcessEngineConfiguration instance will be passed when the ProcessEngine is built. -
createExecutableJobFromOtherJob
Create an executable job from another job -
createTimerJobFromOtherJob
Create a timer job from another job -
createSuspendedJobFromOtherJob
Create a suspended job from another job -
createDeadLetterJobFromOtherJob
Create a dead letter job from another job -
createDeadLetterJobFromHistoryJob
Create a dead letter job from a history job. This is different fromcreateDeadLetterJobFromOtherJob(AbstractRuntimeJobEntity), because history jobs have different data and cannot become timer/suspended/executable jobs. -
createExternalWorkerJobFromOtherJob
Create an external worker job from another job -
copyJobInfo
AbstractRuntimeJobEntity copyJobInfo(AbstractRuntimeJobEntity copyToJob, AbstractRuntimeJobEntity copyFromJob) Copy job info from one job to the other
-