use of org.activiti.engine.impl.persistence.entity.DeadLetterJobEntity in project Activiti by Activiti.
the class MoveJobToDeadLetterJobCmd method execute.
public DeadLetterJobEntity execute(CommandContext commandContext) {
if (jobId == null) {
throw new ActivitiIllegalArgumentException("jobId and job is null");
}
AbstractJobEntity job = commandContext.getTimerJobEntityManager().findById(jobId);
if (job == null) {
job = commandContext.getJobEntityManager().findById(jobId);
}
if (job == null) {
throw new JobNotFoundException(jobId);
}
if (log.isDebugEnabled()) {
log.debug("Moving job to deadletter job table {}", job.getId());
}
DeadLetterJobEntity deadLetterJob = commandContext.getJobManager().moveJobToDeadLetterJob(job);
return deadLetterJob;
}
use of org.activiti.engine.impl.persistence.entity.DeadLetterJobEntity in project Activiti by Activiti.
the class DeleteDeadLetterJobCmd method execute.
public Object execute(CommandContext commandContext) {
DeadLetterJobEntity jobToDelete = getJobToDelete(commandContext);
sendCancelEvent(jobToDelete);
commandContext.getDeadLetterJobEntityManager().delete(jobToDelete);
return null;
}
use of org.activiti.engine.impl.persistence.entity.DeadLetterJobEntity in project Activiti by Activiti.
the class DefaultJobManager method moveJobToDeadLetterJob.
@Override
public DeadLetterJobEntity moveJobToDeadLetterJob(AbstractJobEntity job) {
DeadLetterJobEntity deadLetterJob = createDeadLetterJobFromOtherJob(job);
processEngineConfiguration.getDeadLetterJobEntityManager().insert(deadLetterJob);
if (job instanceof TimerJobEntity) {
processEngineConfiguration.getTimerJobEntityManager().delete((TimerJobEntity) job);
} else if (job instanceof JobEntity) {
processEngineConfiguration.getJobEntityManager().delete((JobEntity) job);
}
return deadLetterJob;
}
use of org.activiti.engine.impl.persistence.entity.DeadLetterJobEntity 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.DeadLetterJobEntity in project Activiti by Activiti.
the class DefaultJobManager method createDeadLetterJobFromOtherJob.
protected DeadLetterJobEntity createDeadLetterJobFromOtherJob(AbstractJobEntity otherJob) {
DeadLetterJobEntity deadLetterJob = processEngineConfiguration.getDeadLetterJobEntityManager().create();
copyJobInfo(deadLetterJob, otherJob);
return deadLetterJob;
}
Aggregations