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
commandExecutorFields inherited from class org.flowable.common.engine.impl.service.CommonServiceImpl
configuration -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbulkMoveDeadLetterJobs(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).voidbulkMoveDeadLetterJobsToHistoryJobs(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 aChangeTenantIdBuilderthat can be used to change the tenant id of the case instances and all the related instances.createCmmnExternalWorkerTransitionBuilder(String externalJobId, String workerId) Create aCmmnExternalWorkerTransitionBuilderthat 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 anExternalWorkerJobAcquireBuilderthat can be used to acquire jobs for an external worker.createExternalWorkerJobFailureBuilder(String externalJobId, String workerId) Create anExternalWorkerJobFailureBuilderthat 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.voiddeleteBatch(String batchId) voiddeleteDeadLetterJob(String jobId) Delete the dead letter job with the provided id.voiddeleteHistoryJob(String jobId) Delete the history job with the provided id.voidDelete the job with the provided id.voiddeleteSuspendedJob(String jobId) Delete the suspended job with the provided id.voiddeleteTimerJob(String jobId) Delete the timer job with the provided id.<T> TexecuteCommand(Command<T> command) <T> TexecuteCommand(CommandConfig config, Command<T> command) voidexecuteHistoryJob(String historyJobId) Forced synchronous execution of a historyJob (eg.voidexecuteJob(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 workerJobwhen 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.voidmoveDeadLetterJobToExecutableJob(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.voidsetJobRetries(String jobId, int retries) Sets the number of retries that a job has left.voidsetTimerJobRetries(String jobId, int retries) Sets the number of retries that a timer job has left.voidUnaquire all locked external worker jobs for worker.voidunacquireAllExternalWorkerJobsForWorker(String workerId, String tenantId) Unaquire all locked external worker jobs for worker and tenant.voidunacquireExternalWorkerJob(String jobId, String workerId) Unaquire a locked external worker job.Methods inherited from class org.flowable.common.engine.impl.service.CommonEngineServiceImpl
getCommandExecutor, setCommandExecutorMethods inherited from class org.flowable.common.engine.impl.service.CommonServiceImpl
getConfiguration
-
Constructor Details
-
CmmnManagementServiceImpl
-
-
Method Details
-
getTableCounts
Description copied from interface:CmmnManagementServiceReturns a map containing {tableName, rowCount} values.- Specified by:
getTableCountsin interfaceCmmnManagementService
-
getTableNames
Description copied from interface:CmmnManagementServiceReturns all relational database tables of the engine.- Specified by:
getTableNamesin interfaceCmmnManagementService
-
executeJob
Description copied from interface:CmmnManagementServiceForced synchronous execution of a job (eg. for administration or testing). The job will be executed, even if the case instance is suspended.- Specified by:
executeJobin interfaceCmmnManagementService- Parameters:
jobId- id of the job to execute, cannot be null.
-
executeHistoryJob
Description copied from interface:CmmnManagementServiceForced synchronous execution of a historyJob (eg. for administration or testing).- Specified by:
executeHistoryJobin interfaceCmmnManagementService- Parameters:
historyJobId- id of the historyjob to execute, cannot be null.
-
getHistoryJobHistoryJson
Description copied from interface:CmmnManagementServiceGet the advanced configuration (storing the history json data) of aHistoryJob.- Specified by:
getHistoryJobHistoryJsonin interfaceCmmnManagementService- Parameters:
historyJobId- id of the history job to execute, cannot be null.
-
deleteHistoryJob
Description copied from interface:CmmnManagementServiceDelete the history job with the provided id.- Specified by:
deleteHistoryJobin interfaceCmmnManagementService- Parameters:
jobId- id of the history job to delete, cannot be null.
-
moveTimerToExecutableJob
Description copied from interface:CmmnManagementServiceMoves 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:
moveTimerToExecutableJobin interfaceCmmnManagementService- Parameters:
jobId- id of the timer job to move, cannot be null.
-
moveJobToDeadLetterJob
Description copied from interface:CmmnManagementServiceMoves 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:
moveJobToDeadLetterJobin interfaceCmmnManagementService- Parameters:
jobId- id of the job to move, cannot be null.
-
moveDeadLetterJobToExecutableJob
Description copied from interface:CmmnManagementServiceMoves 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:
moveDeadLetterJobToExecutableJobin 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:CmmnManagementServiceMoves 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:
bulkMoveDeadLetterJobsin 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:CmmnManagementServiceMoves 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:
bulkMoveDeadLetterJobsToHistoryJobsin 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:CmmnManagementServiceMoves 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:
moveDeadLetterJobToHistoryJobin 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:CmmnManagementServiceMoves a suspended job from the suspended letter job table back to be an executable job. The retries are untouched.- Specified by:
moveSuspendedJobToExecutableJobin interfaceCmmnManagementService- Parameters:
jobId- id of the job to move, cannot be null.
-
deleteJob
Description copied from interface:CmmnManagementServiceDelete the job with the provided id.- Specified by:
deleteJobin interfaceCmmnManagementService- Parameters:
jobId- id of the job to delete, cannot be null.
-
deleteTimerJob
Description copied from interface:CmmnManagementServiceDelete the timer job with the provided id.- Specified by:
deleteTimerJobin interfaceCmmnManagementService- Parameters:
jobId- id of the timer job to delete, cannot be null.
-
deleteSuspendedJob
Description copied from interface:CmmnManagementServiceDelete the suspended job with the provided id.- Specified by:
deleteSuspendedJobin interfaceCmmnManagementService- Parameters:
jobId- id of the suspended job to delete, cannot be null.
-
deleteDeadLetterJob
Description copied from interface:CmmnManagementServiceDelete the dead letter job with the provided id.- Specified by:
deleteDeadLetterJobin interfaceCmmnManagementService- Parameters:
jobId- id of the dead letter job to delete, cannot be null.
-
setJobRetries
Description copied from interface:CmmnManagementServiceSets 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:
setJobRetriesin interfaceCmmnManagementService- Parameters:
jobId- id of the job to modify, cannot be null.retries- number of retries.
-
setTimerJobRetries
Description copied from interface:CmmnManagementServiceSets 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:
setTimerJobRetriesin interfaceCmmnManagementService- Parameters:
jobId- id of the timer job to modify, cannot be null.retries- number of retries.
-
rescheduleTimeDateJob
Description copied from interface:CmmnManagementServiceReschedule a timer job with a new date value.- Specified by:
rescheduleTimeDateJobin interfaceCmmnManagementService- Parameters:
jobId- id of the timer job to reschedule, cannot be null.timeDate- A fixed date
-
rescheduleTimeDateValueJob
Description copied from interface:CmmnManagementServiceReschedule a timer job with a time date value.- Specified by:
rescheduleTimeDateValueJobin 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:CmmnManagementServiceReschedule a timer event listener instance with a new date value.- Specified by:
rescheduleTimerEventListenerInstanceWithDatein 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:CmmnManagementServiceReschedule a timer event listener instance with a time date value.- Specified by:
rescheduleTimerEventListenerInstanceWithDateValuein 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:CmmnManagementServiceReturns a new JobQuery implementation, that can be used to query the jobs.- Specified by:
createJobQueryin interfaceCmmnManagementService
-
createExternalWorkerJobQuery
Description copied from interface:CmmnManagementServiceReturns a new ExternalWorkerJobQuery implementation, that can be used to dynamically query the external worker jobs.- Specified by:
createExternalWorkerJobQueryin interfaceCmmnManagementService
-
createTimerJobQuery
Description copied from interface:CmmnManagementServiceReturns a new TimerJobQuery implementation, that can be used to query the timer jobs.- Specified by:
createTimerJobQueryin interfaceCmmnManagementService
-
createSuspendedJobQuery
Description copied from interface:CmmnManagementServiceReturns a new SuspendedJobQuery implementation, that can be used to query the suspended jobs.- Specified by:
createSuspendedJobQueryin interfaceCmmnManagementService
-
createDeadLetterJobQuery
Description copied from interface:CmmnManagementServiceReturns a new DeadLetterJobQuery implementation, that can be used to query the dead letter jobs.- Specified by:
createDeadLetterJobQueryin interfaceCmmnManagementService
-
getJobExceptionStacktrace
Description copied from interface:CmmnManagementServiceReturns 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:
getJobExceptionStacktracein interfaceCmmnManagementService- Parameters:
jobId- id of the job, cannot be null.
-
getTimerJobExceptionStacktrace
Description copied from interface:CmmnManagementServiceReturns 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:
getTimerJobExceptionStacktracein interfaceCmmnManagementService- Parameters:
jobId- id of the job, cannot be null.
-
getSuspendedJobExceptionStacktrace
Description copied from interface:CmmnManagementServiceReturns 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:
getSuspendedJobExceptionStacktracein interfaceCmmnManagementService- Parameters:
jobId- id of the job, cannot be null.
-
getDeadLetterJobExceptionStacktrace
Description copied from interface:CmmnManagementServiceReturns 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:
getDeadLetterJobExceptionStacktracein interfaceCmmnManagementService- Parameters:
jobId- id of the job, cannot be null.
-
getExternalWorkerJobErrorDetails
Description copied from interface:CmmnManagementServiceReturns the full error details that were passed to the External workerJobwhen the job was last failed. Returns null when the job has no error details.- Specified by:
getExternalWorkerJobErrorDetailsin interfaceCmmnManagementService- Parameters:
jobId- id of the job, cannot be null.
-
handleHistoryCleanupTimerJob
public void handleHistoryCleanupTimerJob()- Specified by:
handleHistoryCleanupTimerJobin interfaceCmmnManagementService
-
createBatchQuery
Description copied from interface:CmmnManagementServiceReturns a new BatchQuery implementation, that can be used to dynamically query the batches.- Specified by:
createBatchQueryin interfaceCmmnManagementService
-
createBatchBuilder
- Specified by:
createBatchBuilderin interfaceCmmnManagementService
-
createBatchPartQuery
Description copied from interface:CmmnManagementServiceReturns a new BatchPartQuery implementation, that can be used to dynamically query the batch parts.- Specified by:
createBatchPartQueryin interfaceCmmnManagementService
-
createBatchPartBuilder
- Specified by:
createBatchPartBuilderin interfaceCmmnManagementService
-
deleteBatch
- Specified by:
deleteBatchin interfaceCmmnManagementService
-
createHistoryJobQuery
Description copied from interface:CmmnManagementServiceReturns a new HistoryJobQuery implementation, that can be used to dynamically query the history jobs.- Specified by:
createHistoryJobQueryin interfaceCmmnManagementService
-
createExternalWorkerJobAcquireBuilder
Description copied from interface:CmmnManagementServiceCreate anExternalWorkerJobAcquireBuilderthat can be used to acquire jobs for an external worker.- Specified by:
createExternalWorkerJobAcquireBuilderin interfaceCmmnManagementService
-
createExternalWorkerJobFailureBuilder
public ExternalWorkerJobFailureBuilder createExternalWorkerJobFailureBuilder(String externalJobId, String workerId) Description copied from interface:CmmnManagementServiceCreate anExternalWorkerJobFailureBuilderthat can be used to fail an external worker job.- Specified by:
createExternalWorkerJobFailureBuilderin 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:CmmnManagementServiceCreate aCmmnExternalWorkerTransitionBuilderthat can be used to transition the status of the external worker job.- Specified by:
createCmmnExternalWorkerTransitionBuilderin interfaceCmmnManagementService
-
unacquireExternalWorkerJob
Description copied from interface:CmmnManagementServiceUnaquire a locked external worker job.- Specified by:
unacquireExternalWorkerJobin interfaceCmmnManagementService
-
unacquireAllExternalWorkerJobsForWorker
Description copied from interface:CmmnManagementServiceUnaquire all locked external worker jobs for worker.- Specified by:
unacquireAllExternalWorkerJobsForWorkerin interfaceCmmnManagementService
-
unacquireAllExternalWorkerJobsForWorker
Description copied from interface:CmmnManagementServiceUnaquire all locked external worker jobs for worker and tenant.- Specified by:
unacquireAllExternalWorkerJobsForWorkerin interfaceCmmnManagementService
-
createChangeTenantIdBuilder
Description copied from interface:CmmnManagementServiceCreate aChangeTenantIdBuilderthat can be used to change the tenant id of the case instances and all the related instances. SeeCmmnChangeTenantIdEntityTypesfor 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:
createChangeTenantIdBuilderin interfaceCmmnManagementService
-
executeCommand
-
executeCommand
-