use of org.activiti.engine.impl.persistence.entity.JobEntityManager in project Activiti by Activiti.
the class DestroyScopeOperation method deleteAllScopeJobs.
private void deleteAllScopeJobs(ExecutionEntity scopeExecution, TimerJobEntityManager timerJobEntityManager) {
Collection<TimerJobEntity> timerJobsForExecution = timerJobEntityManager.findJobsByExecutionId(scopeExecution.getId());
for (TimerJobEntity job : timerJobsForExecution) {
timerJobEntityManager.delete(job);
}
JobEntityManager jobEntityManager = commandContext.getJobEntityManager();
Collection<JobEntity> jobsForExecution = jobEntityManager.findJobsByExecutionId(scopeExecution.getId());
for (JobEntity job : jobsForExecution) {
jobEntityManager.delete(job);
}
SuspendedJobEntityManager suspendedJobEntityManager = commandContext.getSuspendedJobEntityManager();
Collection<SuspendedJobEntity> suspendedJobsForExecution = suspendedJobEntityManager.findJobsByExecutionId(scopeExecution.getId());
for (SuspendedJobEntity job : suspendedJobsForExecution) {
suspendedJobEntityManager.delete(job);
}
DeadLetterJobEntityManager deadLetterJobEntityManager = commandContext.getDeadLetterJobEntityManager();
Collection<DeadLetterJobEntity> deadLetterJobsForExecution = deadLetterJobEntityManager.findJobsByExecutionId(scopeExecution.getId());
for (DeadLetterJobEntity job : deadLetterJobsForExecution) {
deadLetterJobEntityManager.delete(job);
}
}
use of org.activiti.engine.impl.persistence.entity.JobEntityManager in project Activiti by Activiti.
the class IntermediateCatchTimerEventActivityBehavior method eventCancelledByEventGateway.
@Override
public void eventCancelledByEventGateway(DelegateExecution execution) {
JobEntityManager jobEntityManager = Context.getCommandContext().getJobEntityManager();
List<JobEntity> jobEntities = jobEntityManager.findJobsByExecutionId(execution.getId());
for (JobEntity jobEntity : jobEntities) {
// Should be only one
jobEntityManager.delete(jobEntity);
}
Context.getCommandContext().getExecutionEntityManager().deleteExecutionAndRelatedData((ExecutionEntity) execution, DeleteReason.EVENT_BASED_GATEWAY_CANCEL);
}
Aggregations