Interface JobManager
-
- All Known Implementing Classes:
AbstractMessageBasedJobManager,DefaultJobManager
public interface JobManagerContains 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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description AbstractRuntimeJobEntityactivateSuspendedJob(SuspendedJobEntity job)Transforms 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).AbstractRuntimeJobEntitycopyJobInfo(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.DeadLetterJobEntitycreateDeadLetterJobFromHistoryJob(HistoryJobEntity historyJobEntity)Create a dead letter job from a history job.DeadLetterJobEntitycreateDeadLetterJobFromOtherJob(AbstractRuntimeJobEntity otherJob)Create a dead letter job from another jobJobEntitycreateExecutableJobFromOtherJob(AbstractRuntimeJobEntity job)Create an executable job from another jobExternalWorkerJobEntitycreateExternalWorkerJobFromOtherJob(AbstractRuntimeJobEntity otherJob)Create an external worker job from another jobSuspendedJobEntitycreateSuspendedJobFromOtherJob(AbstractRuntimeJobEntity otherJob)Create a suspended job from another jobTimerJobEntitycreateTimerJobFromOtherJob(AbstractRuntimeJobEntity otherJob)Create a timer job from another jobvoidexecute(JobInfo job)Execute a job, which means that the logic (async logic, timer that fires, etc) is executed, typically by a background thread of an executor.StringgetBusinessCalendarName(JobEntity timerEntity, org.flowable.variable.api.delegate.VariableScope variableScope)Get the business calendar name of the job configurationJobmoveDeadLetterJobToExecutableJob(DeadLetterJobEntity deadLetterJobEntity, int retries)Transforms aDeadLetterJobEntityto aJob, thus making it executable again.HistoryJobEntitymoveDeadLetterJobToHistoryJob(DeadLetterJobEntity deadLetterJobEntity, int retries)Transforms aDeadLetterJobEntityto aHistoryJob, thus making it executable again (by the async history executor).JobEntitymoveExternalWorkerJobToExecutableJob(ExternalWorkerJobEntity externalWorkerJob)Moves anExternalWorkerJobEntityto become an asyncJobEntity.DeadLetterJobEntitymoveJobToDeadLetterJob(AbstractRuntimeJobEntity job)Transforms anAbstractRuntimeJobEntityto aDeadLetterJobEntity.SuspendedJobEntitymoveJobToSuspendedJob(AbstractRuntimeJobEntity job)Moves anAbstractRuntimeJobEntityto become aSuspendedJobEntity, such that theAsyncExecutorwon't pick it up anymore for execution.TimerJobEntitymoveJobToTimerJob(AbstractRuntimeJobEntity job)Moves anAbstractRuntimeJobEntityto become aTimerJobEntity.JobEntitymoveTimerJobToExecutableJob(TimerJobEntity timerJob)Moves aTimerJobEntityto become an asyncJobEntity.voidscheduleAsyncJob(JobEntity job)Schedules and async job.HistoryJobEntityscheduleHistoryJob(HistoryJobEntity historyJobEntity)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.voidunacquire(JobInfo job)Unacquires 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 Detail
-
execute
void execute(JobInfo job)
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
void unacquire(JobInfo job)
Unacquires a job, meaning that this job was previously locked, and it is now freed to be acquired by other executor nodes.
-
unacquireWithDecrementRetries
void unacquireWithDecrementRetries(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.
-
createAsyncJob
void createAsyncJob(JobEntity jobEntity, boolean exclusive)
Creates an async job so that it can be continued later in a background thread.
-
scheduleAsyncJob
void scheduleAsyncJob(JobEntity job)
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
void scheduleTimerJob(TimerJobEntity timerJob)
Schedules a timer, meaning it will be inserted in the datastore.
-
getBusinessCalendarName
String getBusinessCalendarName(JobEntity timerEntity, org.flowable.variable.api.delegate.VariableScope variableScope)
Get the business calendar name of the job configuration
-
moveTimerJobToExecutableJob
JobEntity moveTimerJobToExecutableJob(TimerJobEntity timerJob)
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
void bulkMoveTimerJobsToExecutableJobs(List<TimerJobEntity> timerJobEntities)
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
JobEntity moveExternalWorkerJobToExecutableJob(ExternalWorkerJobEntity externalWorkerJob)
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
TimerJobEntity moveJobToTimerJob(AbstractRuntimeJobEntity job)
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
SuspendedJobEntity moveJobToSuspendedJob(AbstractRuntimeJobEntity job)
Moves anAbstractRuntimeJobEntityto become aSuspendedJobEntity, such that theAsyncExecutorwon't pick it up anymore for execution.
-
activateSuspendedJob
AbstractRuntimeJobEntity activateSuspendedJob(SuspendedJobEntity job)
Transforms aSuspendedJobEntityback to anAbstractRuntimeJobEntity(i.e. to what it was originally). The job will now again be able to picked up by theAsyncExecutor.
-
moveJobToDeadLetterJob
DeadLetterJobEntity moveJobToDeadLetterJob(AbstractRuntimeJobEntity job)
Transforms anAbstractRuntimeJobEntityto aDeadLetterJobEntity. This means that the job has been tried a configurable amount of times, but kept failing.
-
moveDeadLetterJobToExecutableJob
Job moveDeadLetterJobToExecutableJob(DeadLetterJobEntity deadLetterJobEntity, int retries)
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.
-
scheduleHistoryJob
HistoryJobEntity scheduleHistoryJob(HistoryJobEntity historyJobEntity)
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
void setJobServiceConfiguration(JobServiceConfiguration jobServiceConfiguration)
The ProcessEngineConfiguration instance will be passed when the ProcessEngine is built.
-
createExecutableJobFromOtherJob
JobEntity createExecutableJobFromOtherJob(AbstractRuntimeJobEntity job)
Create an executable job from another job
-
createTimerJobFromOtherJob
TimerJobEntity createTimerJobFromOtherJob(AbstractRuntimeJobEntity otherJob)
Create a timer job from another job
-
createSuspendedJobFromOtherJob
SuspendedJobEntity createSuspendedJobFromOtherJob(AbstractRuntimeJobEntity otherJob)
Create a suspended job from another job
-
createDeadLetterJobFromOtherJob
DeadLetterJobEntity createDeadLetterJobFromOtherJob(AbstractRuntimeJobEntity otherJob)
Create a dead letter job from another job
-
createDeadLetterJobFromHistoryJob
DeadLetterJobEntity createDeadLetterJobFromHistoryJob(HistoryJobEntity historyJobEntity)
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
ExternalWorkerJobEntity createExternalWorkerJobFromOtherJob(AbstractRuntimeJobEntity otherJob)
Create an external worker job from another job
-
copyJobInfo
AbstractRuntimeJobEntity copyJobInfo(AbstractRuntimeJobEntity copyToJob, AbstractRuntimeJobEntity copyFromJob)
Copy job info from one job to the other
-
-