Class TimerJobEntityManagerImpl
- java.lang.Object
-
- org.flowable.common.engine.impl.persistence.entity.AbstractEntityManager<EntityImpl,DM>
-
- org.flowable.common.engine.impl.persistence.entity.AbstractServiceEngineEntityManager<JobServiceConfiguration,EntityImpl,DM>
-
- org.flowable.job.service.impl.persistence.entity.AbstractJobServiceEngineEntityManager<T,DM>
-
- org.flowable.job.service.impl.persistence.entity.JobInfoEntityManagerImpl<TimerJobEntity,TimerJobDataManager>
-
- org.flowable.job.service.impl.persistence.entity.TimerJobEntityManagerImpl
-
- All Implemented Interfaces:
EntityManager<TimerJobEntity>,JobInfoEntityManager<TimerJobEntity>,TimerJobEntityManager
public class TimerJobEntityManagerImpl extends JobInfoEntityManagerImpl<TimerJobEntity,TimerJobDataManager> implements TimerJobEntityManager
- Author:
- Tijs Rademakers
-
-
Field Summary
-
Fields inherited from class org.flowable.common.engine.impl.persistence.entity.AbstractServiceEngineEntityManager
serviceConfiguration
-
Fields inherited from class org.flowable.common.engine.impl.persistence.entity.AbstractEntityManager
dataManager, engineType
-
-
Constructor Summary
Constructors Constructor Description TimerJobEntityManagerImpl(JobServiceConfiguration jobServiceConfiguration, TimerJobDataManager jobDataManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbulkDeleteTimerJobsWithoutRevisionCheck(List<TimerJobEntity> timerJobEntities)voidbulkUpdateJobLockWithoutRevisionCheck(List<TimerJobEntity> timerJobEntities, String lockOwner, Date lockExpirationTime)protected DatecalculateNextTimer(JobEntity timerEntity, org.flowable.variable.api.delegate.VariableScope variableScope)protected intcalculateRepeatValue(JobEntity timerEntity)TimerJobEntitycreateAndCalculateNextTimer(JobEntity timerEntity, org.flowable.variable.api.delegate.VariableScope variableScope)Creates a newTimerJobEntity, typically when a timer is used in a repeating way.protected TimerJobEntitycreateTimer(JobEntity te)voiddelete(TimerJobEntity jobEntity)voiddelete(TimerJobEntity jobEntity, boolean fireDeleteEvent)protected booleandoInsert(TimerJobEntity jobEntity, boolean fireCreateEvent)TimerJobEntityfindJobByCorrelationId(String correlationId)Find the timer job with the given correlation id.longfindJobCountByQueryCriteria(TimerJobQueryImpl jobQuery)Same asTimerJobEntityManager.findJobsByQueryCriteria(TimerJobQueryImpl), but only returns a count and not the instances itself.List<TimerJobEntity>findJobsByExecutionId(String id)Returns allJobEntityinstances related to on ExecutionEntity.List<TimerJobEntity>findJobsByProcessInstanceId(String id)Returns allJobEntityinstances related to one process instance ExecutionEntity.List<Job>findJobsByQueryCriteria(TimerJobQueryImpl jobQuery)Executes aJobQueryImpland returns the matchingTimerJobEntityinstances.List<TimerJobEntity>findJobsByScopeIdAndSubScopeId(String scopeId, String subScopeId)Returns allTimerJobEntityfor the given scope and subscope.List<TimerJobEntity>findJobsByTypeAndProcessDefinitionId(String jobHandlerType, String processDefinitionId)Returns theTimerJobEntityfor a given process definition.List<TimerJobEntity>findJobsByTypeAndProcessDefinitionKeyAndTenantId(String jobHandlerType, String processDefinitionKey, String tenantId)The same asTimerJobEntityManager.findJobsByTypeAndProcessDefinitionId(String, String), but by key and for a specific tenantId.List<TimerJobEntity>findJobsByTypeAndProcessDefinitionKeyNoTenantId(String jobHandlerType, String processDefinitionKey)The same asTimerJobEntityManager.findJobsByTypeAndProcessDefinitionId(String, String), but by key and specifically for the 'no tenant' mode.voidinsert(TimerJobEntity jobEntity)voidinsert(TimerJobEntity jobEntity, boolean fireCreateEvent)booleaninsertTimerJobEntity(TimerJobEntity timerJobEntity)Insert theTimerJobEntity, similar to insert(TimerJobEntity), but returns a boolean in case the insert did not go through.protected booleanisValidTime(JobEntity timerEntity, Date newTimerDate, org.flowable.variable.api.delegate.VariableScope variableScope)protected voidsetNewRepeat(JobEntity timerEntity, int newRepeatValue)voidupdateJobTenantIdForDeployment(String deploymentId, String newTenantId)Changes the tenantId for all jobs related to a given DeploymentEntity.-
Methods inherited from class org.flowable.job.service.impl.persistence.entity.JobInfoEntityManagerImpl
findExpiredJobs, findJobsToExecute, resetExpiredJob
-
Methods inherited from class org.flowable.job.service.impl.persistence.entity.AbstractJobServiceEngineEntityManager
bulkDeleteByteArraysById, createEntityEvent, deleteByteArrayRef
-
Methods inherited from class org.flowable.common.engine.impl.persistence.entity.AbstractServiceEngineEntityManager
getClock, getEventDispatcher, getServiceConfiguration
-
Methods inherited from class org.flowable.common.engine.impl.persistence.entity.AbstractEntityManager
create, delete, findById, fireEntityDeletedEvent, fireEntityInsertedEvent, fireEntityUpdatedEvent, getDataManager, setDataManager, update, update
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.flowable.common.engine.impl.persistence.entity.EntityManager
create, delete, findById, update, update
-
Methods inherited from interface org.flowable.job.service.impl.persistence.entity.JobInfoEntityManager
findExpiredJobs, findJobsToExecute, findJobsToExecuteAndLockInBulk, resetExpiredJob
-
-
-
-
Constructor Detail
-
TimerJobEntityManagerImpl
public TimerJobEntityManagerImpl(JobServiceConfiguration jobServiceConfiguration, TimerJobDataManager jobDataManager)
-
-
Method Detail
-
createAndCalculateNextTimer
public TimerJobEntity createAndCalculateNextTimer(JobEntity timerEntity, org.flowable.variable.api.delegate.VariableScope variableScope)
Description copied from interface:TimerJobEntityManagerCreates a newTimerJobEntity, typically when a timer is used in a repeating way. The returnsTimerJobEntityis not yet inserted.Returns null if the timer has finished its repetitions.
- Specified by:
createAndCalculateNextTimerin interfaceTimerJobEntityManager
-
findJobByCorrelationId
public TimerJobEntity findJobByCorrelationId(String correlationId)
Description copied from interface:TimerJobEntityManagerFind the timer job with the given correlation id.- Specified by:
findJobByCorrelationIdin interfaceTimerJobEntityManager
-
findJobsByTypeAndProcessDefinitionId
public List<TimerJobEntity> findJobsByTypeAndProcessDefinitionId(String jobHandlerType, String processDefinitionId)
Description copied from interface:TimerJobEntityManagerReturns theTimerJobEntityfor a given process definition.This is for example used when deleting a process definition: it finds the
TimerJobEntityrepresenting the timer start events.- Specified by:
findJobsByTypeAndProcessDefinitionIdin interfaceTimerJobEntityManager
-
findJobsByTypeAndProcessDefinitionKeyNoTenantId
public List<TimerJobEntity> findJobsByTypeAndProcessDefinitionKeyNoTenantId(String jobHandlerType, String processDefinitionKey)
Description copied from interface:TimerJobEntityManagerThe same asTimerJobEntityManager.findJobsByTypeAndProcessDefinitionId(String, String), but by key and specifically for the 'no tenant' mode.- Specified by:
findJobsByTypeAndProcessDefinitionKeyNoTenantIdin interfaceTimerJobEntityManager
-
findJobsByTypeAndProcessDefinitionKeyAndTenantId
public List<TimerJobEntity> findJobsByTypeAndProcessDefinitionKeyAndTenantId(String jobHandlerType, String processDefinitionKey, String tenantId)
Description copied from interface:TimerJobEntityManagerThe same asTimerJobEntityManager.findJobsByTypeAndProcessDefinitionId(String, String), but by key and for a specific tenantId.- Specified by:
findJobsByTypeAndProcessDefinitionKeyAndTenantIdin interfaceTimerJobEntityManager
-
findJobsByExecutionId
public List<TimerJobEntity> findJobsByExecutionId(String id)
Description copied from interface:JobInfoEntityManagerReturns allJobEntityinstances related to on ExecutionEntity.- Specified by:
findJobsByExecutionIdin interfaceJobInfoEntityManager<TimerJobEntity>- Overrides:
findJobsByExecutionIdin classJobInfoEntityManagerImpl<TimerJobEntity,TimerJobDataManager>
-
findJobsByProcessInstanceId
public List<TimerJobEntity> findJobsByProcessInstanceId(String id)
Description copied from interface:JobInfoEntityManagerReturns allJobEntityinstances related to one process instance ExecutionEntity.- Specified by:
findJobsByProcessInstanceIdin interfaceJobInfoEntityManager<TimerJobEntity>- Overrides:
findJobsByProcessInstanceIdin classJobInfoEntityManagerImpl<TimerJobEntity,TimerJobDataManager>
-
findJobsByScopeIdAndSubScopeId
public List<TimerJobEntity> findJobsByScopeIdAndSubScopeId(String scopeId, String subScopeId)
Description copied from interface:TimerJobEntityManagerReturns allTimerJobEntityfor the given scope and subscope.- Specified by:
findJobsByScopeIdAndSubScopeIdin interfaceTimerJobEntityManager
-
findJobsByQueryCriteria
public List<Job> findJobsByQueryCriteria(TimerJobQueryImpl jobQuery)
Description copied from interface:TimerJobEntityManagerExecutes aJobQueryImpland returns the matchingTimerJobEntityinstances.- Specified by:
findJobsByQueryCriteriain interfaceTimerJobEntityManager
-
findJobCountByQueryCriteria
public long findJobCountByQueryCriteria(TimerJobQueryImpl jobQuery)
Description copied from interface:TimerJobEntityManagerSame asTimerJobEntityManager.findJobsByQueryCriteria(TimerJobQueryImpl), but only returns a count and not the instances itself.- Specified by:
findJobCountByQueryCriteriain interfaceTimerJobEntityManager
-
updateJobTenantIdForDeployment
public void updateJobTenantIdForDeployment(String deploymentId, String newTenantId)
Description copied from interface:JobInfoEntityManagerChanges the tenantId for all jobs related to a given DeploymentEntity.- Specified by:
updateJobTenantIdForDeploymentin interfaceJobInfoEntityManager<TimerJobEntity>- Overrides:
updateJobTenantIdForDeploymentin classJobInfoEntityManagerImpl<TimerJobEntity,TimerJobDataManager>
-
insertTimerJobEntity
public boolean insertTimerJobEntity(TimerJobEntity timerJobEntity)
Description copied from interface:TimerJobEntityManagerInsert theTimerJobEntity, similar to insert(TimerJobEntity), but returns a boolean in case the insert did not go through. This could happen if the execution related to theTimerJobEntityhas been removed (for example due to a task complete for a timer boundary on that task).- Specified by:
insertTimerJobEntityin interfaceTimerJobEntityManager
-
insert
public void insert(TimerJobEntity jobEntity)
- Specified by:
insertin interfaceEntityManager<TimerJobEntity>- Overrides:
insertin classAbstractEntityManager<TimerJobEntity,TimerJobDataManager>
-
insert
public void insert(TimerJobEntity jobEntity, boolean fireCreateEvent)
- Specified by:
insertin interfaceEntityManager<TimerJobEntity>- Overrides:
insertin classAbstractEntityManager<TimerJobEntity,TimerJobDataManager>
-
doInsert
protected boolean doInsert(TimerJobEntity jobEntity, boolean fireCreateEvent)
-
delete
public void delete(TimerJobEntity jobEntity)
- Specified by:
deletein interfaceEntityManager<TimerJobEntity>- Overrides:
deletein classAbstractEntityManager<TimerJobEntity,TimerJobDataManager>
-
delete
public void delete(TimerJobEntity jobEntity, boolean fireDeleteEvent)
- Specified by:
deletein interfaceEntityManager<TimerJobEntity>- Overrides:
deletein classAbstractEntityManager<TimerJobEntity,TimerJobDataManager>
-
bulkUpdateJobLockWithoutRevisionCheck
public void bulkUpdateJobLockWithoutRevisionCheck(List<TimerJobEntity> timerJobEntities, String lockOwner, Date lockExpirationTime)
- Specified by:
bulkUpdateJobLockWithoutRevisionCheckin interfaceJobInfoEntityManager<TimerJobEntity>- Overrides:
bulkUpdateJobLockWithoutRevisionCheckin classJobInfoEntityManagerImpl<TimerJobEntity,TimerJobDataManager>
-
bulkDeleteTimerJobsWithoutRevisionCheck
public void bulkDeleteTimerJobsWithoutRevisionCheck(List<TimerJobEntity> timerJobEntities)
- Specified by:
bulkDeleteTimerJobsWithoutRevisionCheckin interfaceTimerJobEntityManager
-
createTimer
protected TimerJobEntity createTimer(JobEntity te)
-
setNewRepeat
protected void setNewRepeat(JobEntity timerEntity, int newRepeatValue)
-
isValidTime
protected boolean isValidTime(JobEntity timerEntity, Date newTimerDate, org.flowable.variable.api.delegate.VariableScope variableScope)
-
calculateNextTimer
protected Date calculateNextTimer(JobEntity timerEntity, org.flowable.variable.api.delegate.VariableScope variableScope)
-
calculateRepeatValue
protected int calculateRepeatValue(JobEntity timerEntity)
-
-