Package org.flowable.cmmn.engine.impl
Class CmmnManagementServiceImpl
java.lang.Object
org.flowable.common.engine.impl.service.CommonServiceImpl<C>
org.flowable.common.engine.impl.service.CommonEngineServiceImpl<CmmnEngineConfiguration>
org.flowable.cmmn.engine.impl.CmmnManagementServiceImpl
- All Implemented Interfaces:
CmmnManagementService
public class CmmnManagementServiceImpl
extends CommonEngineServiceImpl<CmmnEngineConfiguration>
implements CmmnManagementService
- Author:
- Joram Barrez
-
Field Summary
Fields inherited from class org.flowable.common.engine.impl.service.CommonEngineServiceImpl
commandExecutor
Fields inherited from class org.flowable.common.engine.impl.service.CommonServiceImpl
configuration
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
bulkMoveDeadLetterJobs
(Collection<String> jobIds, int retries) Moves a bulk of jobs that are in the dead letter job table back to the executable job table, and resets the retries (as the retries was 0 when it was put into the dead letter job table).void
bulkMoveDeadLetterJobsToHistoryJobs
(Collection<String> jobIds, int retries) Moves a bulk of jobs that are in the dead letter job table back to be history jobs, and resets the retries (as the retries was 0 when it was put into the dead letter job table).createBatchPartBuilder
(Batch batch) Returns a new BatchPartQuery implementation, that can be used to dynamically query the batch parts.Returns a new BatchQuery implementation, that can be used to dynamically query the batches.createChangeTenantIdBuilder
(String fromTenantId, String toTenantId) Create aChangeTenantIdBuilder
that can be used to change the tenant id of the case instances and all the related instances.createCmmnExternalWorkerTransitionBuilder
(String externalJobId, String workerId) Create aCmmnExternalWorkerTransitionBuilder
that can be used to transition the status of the external worker job.Returns a new DeadLetterJobQuery implementation, that can be used to query the dead letter jobs.Create anExternalWorkerJobAcquireBuilder
that can be used to acquire jobs for an external worker.createExternalWorkerJobFailureBuilder
(String externalJobId, String workerId) Create anExternalWorkerJobFailureBuilder
that can be used to fail an external worker job.Returns a new ExternalWorkerJobQuery implementation, that can be used to dynamically query the external worker jobs.Returns a new HistoryJobQuery implementation, that can be used to dynamically query the history jobs.Returns a new JobQuery implementation, that can be used to query the jobs.Returns a new SuspendedJobQuery implementation, that can be used to query the suspended jobs.Returns a new TimerJobQuery implementation, that can be used to query the timer jobs.void
deleteBatch
(String batchId) void
deleteDeadLetterJob
(String jobId) Delete the dead letter job with the provided id.void
deleteHistoryJob
(String jobId) Delete the history job with the provided id.void
Delete the job with the provided id.void
deleteSuspendedJob
(String jobId) Delete the suspended job with the provided id.void
deleteTimerJob
(String jobId) Delete the timer job with the provided id.<T> T
executeCommand
(Command<T> command) <T> T
executeCommand
(CommandConfig config, Command<T> command) void
executeHistoryJob
(String historyJobId) Forced synchronous execution of a historyJob (eg.void
executeJob
(String jobId) Forced synchronous execution of a job (eg.Returns the full stacktrace of the exception that occurs when the deadletter job with the given id was last executed.Returns the full error details that were passed to the External workerJob
when the job was last failed.getHistoryJobHistoryJson
(String historyJobId) Get the advanced configuration (storing the history json data) of aHistoryJob
.getJobExceptionStacktrace
(String jobId) Returns the full stacktrace of the exception that occurs when the job with the given id was last executed.Returns the full stacktrace of the exception that occurs when the suspended with the given id was last executed.Returns a map containing {tableName, rowCount} values.Returns all relational database tables of the engine.Returns the full stacktrace of the exception that occurs when the timer job with the given id was last executed.void
moveDeadLetterJobToExecutableJob
(String jobId, int retries) Moves a job that is in the dead letter job table back to be an executable job, and resetting the retries (as the retries were probably 0 when it was put into the dead letter job table).moveDeadLetterJobToHistoryJob
(String jobId, int retries) Moves a job that is in the dead letter job table back to be a history job, and resetting the retries (as the retries was 0 when it was put into the dead letter job table).moveJobToDeadLetterJob
(String jobId) Moves a job to the dead letter job table (eg.Moves a suspended job from the suspended letter job table back to be an executable job.moveTimerToExecutableJob
(String jobId) Moves a timer job to the executable job table (eg.rescheduleTimeDateJob
(String jobId, Date timeDate) Reschedule a timer job with a new date value.rescheduleTimeDateValueJob
(String jobId, String timeDateValue) Reschedule a timer job with a time date value.rescheduleTimerEventListenerInstanceWithDate
(String eventListenerInstanceId, Date timeDate) Reschedule a timer event listener instance with a new date value.rescheduleTimerEventListenerInstanceWithDateValue
(String eventListenerInstanceId, String timeDateValue) Reschedule a timer event listener instance with a time date value.void
setJobRetries
(String jobId, int retries) Sets the number of retries that a job has left.void
setTimerJobRetries
(String jobId, int retries) Sets the number of retries that a timer job has left.void
Unaquire all locked external worker jobs for worker.void
unacquireAllExternalWorkerJobsForWorker
(String workerId, String tenantId) Unaquire all locked external worker jobs for worker and tenant.void
unacquireExternalWorkerJob
(String jobId, String workerId) Unaquire a locked external worker job.Methods inherited from class org.flowable.common.engine.impl.service.CommonEngineServiceImpl
getCommandExecutor, setCommandExecutor
Methods inherited from class org.flowable.common.engine.impl.service.CommonServiceImpl
getConfiguration
-
Constructor Details
-
CmmnManagementServiceImpl
-
-
Method Details
-
getTableCounts
Description copied from interface:CmmnManagementService
Returns a map containing {tableName, rowCount} values.- Specified by:
getTableCounts
in interfaceCmmnManagementService
-
getTableNames
Description copied from interface:CmmnManagementService
Returns all relational database tables of the engine.- Specified by:
getTableNames
in interfaceCmmnManagementService
-
executeJob
Description copied from interface:CmmnManagementService
Forced synchronous execution of a job (eg. for administration or testing). The job will be executed, even if the case instance is suspended.- Specified by:
executeJob
in interfaceCmmnManagementService
- Parameters:
jobId
- id of the job to execute, cannot be null.
-
executeHistoryJob
Description copied from interface:CmmnManagementService
Forced synchronous execution of a historyJob (eg. for administration or testing).- Specified by:
executeHistoryJob
in interfaceCmmnManagementService
- Parameters:
historyJobId
- id of the historyjob to execute, cannot be null.
-
getHistoryJobHistoryJson
Description copied from interface:CmmnManagementService
Get the advanced configuration (storing the history json data) of aHistoryJob
.- Specified by:
getHistoryJobHistoryJson
in interfaceCmmnManagementService
- Parameters:
historyJobId
- id of the history job to execute, cannot be null.
-
deleteHistoryJob
Description copied from interface:CmmnManagementService
Delete the history job with the provided id.- Specified by:
deleteHistoryJob
in interfaceCmmnManagementService
- Parameters:
jobId
- id of the history job to delete, cannot be null.
-
moveTimerToExecutableJob
Description copied from interface:CmmnManagementService
Moves a timer job to the executable job table (eg. for administration or testing). The timer job will be moved, even if the case instance is suspended.- Specified by:
moveTimerToExecutableJob
in interfaceCmmnManagementService
- Parameters:
jobId
- id of the timer job to move, cannot be null.
-
moveJobToDeadLetterJob
Description copied from interface:CmmnManagementService
Moves a job to the dead letter job table (eg. for administration or testing). The job will be moved, even if the case instance is suspended or there are retries left.- Specified by:
moveJobToDeadLetterJob
in interfaceCmmnManagementService
- Parameters:
jobId
- id of the job to move, cannot be null.
-
moveDeadLetterJobToExecutableJob
Description copied from interface:CmmnManagementService
Moves a job that is in the dead letter job table back to be an executable job, and resetting the retries (as the retries were probably 0 when it was put into the dead letter job table).- Specified by:
moveDeadLetterJobToExecutableJob
in interfaceCmmnManagementService
- Parameters:
jobId
- id of the job to move, cannot be null.retries
- the number of retries (value greater than 0) which will be set on the job.
-
bulkMoveDeadLetterJobs
Description copied from interface:CmmnManagementService
Moves a bulk of jobs that are in the dead letter job table back to the executable job table, and resets the retries (as the retries was 0 when it was put into the dead letter job table).- Specified by:
bulkMoveDeadLetterJobs
in interfaceCmmnManagementService
- Parameters:
jobIds
- ids of the jobs to move, cannot be null.retries
- the number of retries (value greater than 0) which will be set on the jobs.
-
bulkMoveDeadLetterJobsToHistoryJobs
Description copied from interface:CmmnManagementService
Moves a bulk of jobs that are in the dead letter job table back to be history jobs, and resets the retries (as the retries was 0 when it was put into the dead letter job table).- Specified by:
bulkMoveDeadLetterJobsToHistoryJobs
in interfaceCmmnManagementService
- Parameters:
jobIds
- ids of the jobs to move, cannot be null.retries
- the number of retries (value greater than 0) which will be set on the jobs.
-
moveDeadLetterJobToHistoryJob
Description copied from interface:CmmnManagementService
Moves a job that is in the dead letter job table back to be a history job, and resetting the retries (as the retries was 0 when it was put into the dead letter job table).- Specified by:
moveDeadLetterJobToHistoryJob
in interfaceCmmnManagementService
- Parameters:
jobId
- id of the job to move, cannot be null.retries
- the number of retries (value greater than 0) which will be set on the job.
-
moveSuspendedJobToExecutableJob
Description copied from interface:CmmnManagementService
Moves a suspended job from the suspended letter job table back to be an executable job. The retries are untouched.- Specified by:
moveSuspendedJobToExecutableJob
in interfaceCmmnManagementService
- Parameters:
jobId
- id of the job to move, cannot be null.
-
deleteJob
Description copied from interface:CmmnManagementService
Delete the job with the provided id.- Specified by:
deleteJob
in interfaceCmmnManagementService
- Parameters:
jobId
- id of the job to delete, cannot be null.
-
deleteTimerJob
Description copied from interface:CmmnManagementService
Delete the timer job with the provided id.- Specified by:
deleteTimerJob
in interfaceCmmnManagementService
- Parameters:
jobId
- id of the timer job to delete, cannot be null.
-
deleteSuspendedJob
Description copied from interface:CmmnManagementService
Delete the suspended job with the provided id.- Specified by:
deleteSuspendedJob
in interfaceCmmnManagementService
- Parameters:
jobId
- id of the suspended job to delete, cannot be null.
-
deleteDeadLetterJob
Description copied from interface:CmmnManagementService
Delete the dead letter job with the provided id.- Specified by:
deleteDeadLetterJob
in interfaceCmmnManagementService
- Parameters:
jobId
- id of the dead letter job to delete, cannot be null.
-
setJobRetries
Description copied from interface:CmmnManagementService
Sets the number of retries that a job has left. Whenever the JobExecutor fails to execute a job, this value is decremented. When it hits zero, the job is supposed to be dead and not retried again. In that case, this method can be used to increase the number of retries.- Specified by:
setJobRetries
in interfaceCmmnManagementService
- Parameters:
jobId
- id of the job to modify, cannot be null.retries
- number of retries.
-
setTimerJobRetries
Description copied from interface:CmmnManagementService
Sets the number of retries that a timer job has left. Whenever the JobExecutor fails to execute a timer job, this value is decremented. When it hits zero, the job is supposed to be dead and not retried again. In that case, this method can be used to increase the number of retries.- Specified by:
setTimerJobRetries
in interfaceCmmnManagementService
- Parameters:
jobId
- id of the timer job to modify, cannot be null.retries
- number of retries.
-
rescheduleTimeDateJob
Description copied from interface:CmmnManagementService
Reschedule a timer job with a new date value.- Specified by:
rescheduleTimeDateJob
in interfaceCmmnManagementService
- Parameters:
jobId
- id of the timer job to reschedule, cannot be null.timeDate
- A fixed date
-
rescheduleTimeDateValueJob
Description copied from interface:CmmnManagementService
Reschedule a timer job with a time date value.- Specified by:
rescheduleTimeDateValueJob
in interfaceCmmnManagementService
- Parameters:
jobId
- id of the timer job to reschedule, cannot be null.timeDateValue
- A fixed date in ISO 8601 format, when job will be fired
-
rescheduleTimerEventListenerInstanceWithDate
public Job rescheduleTimerEventListenerInstanceWithDate(String eventListenerInstanceId, Date timeDate) Description copied from interface:CmmnManagementService
Reschedule a timer event listener instance with a new date value.- Specified by:
rescheduleTimerEventListenerInstanceWithDate
in interfaceCmmnManagementService
- Parameters:
eventListenerInstanceId
- id of the timer event listener instance to reschedule, cannot be null.timeDate
- A fixed date
-
rescheduleTimerEventListenerInstanceWithDateValue
public Job rescheduleTimerEventListenerInstanceWithDateValue(String eventListenerInstanceId, String timeDateValue) Description copied from interface:CmmnManagementService
Reschedule a timer event listener instance with a time date value.- Specified by:
rescheduleTimerEventListenerInstanceWithDateValue
in interfaceCmmnManagementService
- Parameters:
eventListenerInstanceId
- id of the timer event listener instance to reschedule, cannot be null.timeDateValue
- A fixed date in ISO 8601 format, when job will be fired
-
createJobQuery
Description copied from interface:CmmnManagementService
Returns a new JobQuery implementation, that can be used to query the jobs.- Specified by:
createJobQuery
in interfaceCmmnManagementService
-
createExternalWorkerJobQuery
Description copied from interface:CmmnManagementService
Returns a new ExternalWorkerJobQuery implementation, that can be used to dynamically query the external worker jobs.- Specified by:
createExternalWorkerJobQuery
in interfaceCmmnManagementService
-
createTimerJobQuery
Description copied from interface:CmmnManagementService
Returns a new TimerJobQuery implementation, that can be used to query the timer jobs.- Specified by:
createTimerJobQuery
in interfaceCmmnManagementService
-
createSuspendedJobQuery
Description copied from interface:CmmnManagementService
Returns a new SuspendedJobQuery implementation, that can be used to query the suspended jobs.- Specified by:
createSuspendedJobQuery
in interfaceCmmnManagementService
-
createDeadLetterJobQuery
Description copied from interface:CmmnManagementService
Returns a new DeadLetterJobQuery implementation, that can be used to query the dead letter jobs.- Specified by:
createDeadLetterJobQuery
in interfaceCmmnManagementService
-
getJobExceptionStacktrace
Description copied from interface:CmmnManagementService
Returns the full stacktrace of the exception that occurs when the job with the given id was last executed. Returns null when the job has no exception stacktrace.- Specified by:
getJobExceptionStacktrace
in interfaceCmmnManagementService
- Parameters:
jobId
- id of the job, cannot be null.
-
getTimerJobExceptionStacktrace
Description copied from interface:CmmnManagementService
Returns the full stacktrace of the exception that occurs when the timer job with the given id was last executed. Returns null when the job has no exception stacktrace.- Specified by:
getTimerJobExceptionStacktrace
in interfaceCmmnManagementService
- Parameters:
jobId
- id of the job, cannot be null.
-
getSuspendedJobExceptionStacktrace
Description copied from interface:CmmnManagementService
Returns the full stacktrace of the exception that occurs when the suspended with the given id was last executed. Returns null when the job has no exception stacktrace.- Specified by:
getSuspendedJobExceptionStacktrace
in interfaceCmmnManagementService
- Parameters:
jobId
- id of the job, cannot be null.
-
getDeadLetterJobExceptionStacktrace
Description copied from interface:CmmnManagementService
Returns the full stacktrace of the exception that occurs when the deadletter job with the given id was last executed. Returns null when the job has no exception stacktrace.- Specified by:
getDeadLetterJobExceptionStacktrace
in interfaceCmmnManagementService
- Parameters:
jobId
- id of the job, cannot be null.
-
getExternalWorkerJobErrorDetails
Description copied from interface:CmmnManagementService
Returns the full error details that were passed to the External workerJob
when the job was last failed. Returns null when the job has no error details.- Specified by:
getExternalWorkerJobErrorDetails
in interfaceCmmnManagementService
- Parameters:
jobId
- id of the job, cannot be null.
-
handleHistoryCleanupTimerJob
public void handleHistoryCleanupTimerJob()- Specified by:
handleHistoryCleanupTimerJob
in interfaceCmmnManagementService
-
createBatchQuery
Description copied from interface:CmmnManagementService
Returns a new BatchQuery implementation, that can be used to dynamically query the batches.- Specified by:
createBatchQuery
in interfaceCmmnManagementService
-
createBatchBuilder
- Specified by:
createBatchBuilder
in interfaceCmmnManagementService
-
createBatchPartQuery
Description copied from interface:CmmnManagementService
Returns a new BatchPartQuery implementation, that can be used to dynamically query the batch parts.- Specified by:
createBatchPartQuery
in interfaceCmmnManagementService
-
createBatchPartBuilder
- Specified by:
createBatchPartBuilder
in interfaceCmmnManagementService
-
deleteBatch
- Specified by:
deleteBatch
in interfaceCmmnManagementService
-
createHistoryJobQuery
Description copied from interface:CmmnManagementService
Returns a new HistoryJobQuery implementation, that can be used to dynamically query the history jobs.- Specified by:
createHistoryJobQuery
in interfaceCmmnManagementService
-
createExternalWorkerJobAcquireBuilder
Description copied from interface:CmmnManagementService
Create anExternalWorkerJobAcquireBuilder
that can be used to acquire jobs for an external worker.- Specified by:
createExternalWorkerJobAcquireBuilder
in interfaceCmmnManagementService
-
createExternalWorkerJobFailureBuilder
public ExternalWorkerJobFailureBuilder createExternalWorkerJobFailureBuilder(String externalJobId, String workerId) Description copied from interface:CmmnManagementService
Create anExternalWorkerJobFailureBuilder
that can be used to fail an external worker job.- Specified by:
createExternalWorkerJobFailureBuilder
in interfaceCmmnManagementService
- Parameters:
externalJobId
- the id of the external worker jobworkerId
- the id of the worker doing the action
-
createCmmnExternalWorkerTransitionBuilder
public CmmnExternalWorkerTransitionBuilder createCmmnExternalWorkerTransitionBuilder(String externalJobId, String workerId) Description copied from interface:CmmnManagementService
Create aCmmnExternalWorkerTransitionBuilder
that can be used to transition the status of the external worker job.- Specified by:
createCmmnExternalWorkerTransitionBuilder
in interfaceCmmnManagementService
-
unacquireExternalWorkerJob
Description copied from interface:CmmnManagementService
Unaquire a locked external worker job.- Specified by:
unacquireExternalWorkerJob
in interfaceCmmnManagementService
-
unacquireAllExternalWorkerJobsForWorker
Description copied from interface:CmmnManagementService
Unaquire all locked external worker jobs for worker.- Specified by:
unacquireAllExternalWorkerJobsForWorker
in interfaceCmmnManagementService
-
unacquireAllExternalWorkerJobsForWorker
Description copied from interface:CmmnManagementService
Unaquire all locked external worker jobs for worker and tenant.- Specified by:
unacquireAllExternalWorkerJobsForWorker
in interfaceCmmnManagementService
-
createChangeTenantIdBuilder
Description copied from interface:CmmnManagementService
Create aChangeTenantIdBuilder
that can be used to change the tenant id of the case instances and all the related instances. SeeCmmnChangeTenantIdEntityTypes
for related instances.You must provide the source tenant id and the destination tenant id. All instances from the source tenant id in the CMMN scope will be changed to the target tenant id.
- Specified by:
createChangeTenantIdBuilder
in interfaceCmmnManagementService
-
executeCommand
-
executeCommand
-