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 SummaryModifier 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- 
executeExecute a job, which means that the logic (async logic, timer that fires, etc) is executed, typically by a background thread of an executor.
- 
unacquireUnacquires a job, meaning that this job was previously locked, and it is now freed to be acquired by other executor nodes.
- 
unacquireWithDecrementRetriesUnacquires a job, meaning that this job was previously locked, and it is now freed to be acquired by other executor nodes.
- 
createAsyncJobCreates an async job so that it can be continued later in a background thread.
- 
scheduleAsyncJobSchedules and async job. If theAsyncExecutoris running, it can be executed immediately after the transaction. Otherwise it can be picked up by other executors.
- 
scheduleTimerJobSchedules a timer, meaning it will be inserted in the datastore.
- 
getBusinessCalendarNameGet the business calendar name of the job configuration
- 
moveTimerJobToExecutableJobMoves 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.
- 
bulkMoveTimerJobsToExecutableJobsMoves 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.
- 
moveExternalWorkerJobToExecutableJobMoves 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.
- 
moveJobToTimerJobMoves 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.
- 
moveJobToSuspendedJobMoves anAbstractRuntimeJobEntityto become aSuspendedJobEntity, such that theAsyncExecutorwon't pick it up anymore for execution.
- 
activateSuspendedJobTransforms aSuspendedJobEntityback to anAbstractRuntimeJobEntity(i.e. to what it was originally). The job will now again be able to picked up by theAsyncExecutor.
- 
moveJobToDeadLetterJobTransforms anAbstractRuntimeJobEntityto aDeadLetterJobEntity. This means that the job has been tried a configurable amount of times, but kept failing.
- 
moveDeadLetterJobToExecutableJobTransforms 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.
- 
moveDeadLetterJobToHistoryJobHistoryJobEntity 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
- 
scheduleHistoryJobHistoryJobEntity 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.
- 
setJobServiceConfigurationThe ProcessEngineConfiguration instance will be passed when the ProcessEngine is built.
- 
createExecutableJobFromOtherJobCreate an executable job from another job
- 
createTimerJobFromOtherJobCreate a timer job from another job
- 
createSuspendedJobFromOtherJobCreate a suspended job from another job
- 
createDeadLetterJobFromOtherJobCreate a dead letter job from another job
- 
createDeadLetterJobFromHistoryJobCreate 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.
- 
createExternalWorkerJobFromOtherJobCreate an external worker job from another job
- 
copyJobInfoAbstractRuntimeJobEntity copyJobInfo(AbstractRuntimeJobEntity copyToJob, AbstractRuntimeJobEntity copyFromJob) Copy job info from one job to the other
 
-