Search in sources :

Example 6 with DeadLetterJobEntity

use of org.activiti.engine.impl.persistence.entity.DeadLetterJobEntity in project Activiti by Activiti.

the class DefaultJobManager method moveDeadLetterJobToExecutableJob.

@Override
public JobEntity moveDeadLetterJobToExecutableJob(DeadLetterJobEntity deadLetterJobEntity, int retries) {
    if (deadLetterJobEntity == null) {
        throw new ActivitiIllegalArgumentException("Null job provided");
    }
    JobEntity executableJob = createExecutableJobFromOtherJob(deadLetterJobEntity);
    executableJob.setRetries(retries);
    boolean insertSuccesful = processEngineConfiguration.getJobEntityManager().insertJobEntity(executableJob);
    if (insertSuccesful) {
        processEngineConfiguration.getDeadLetterJobEntityManager().delete(deadLetterJobEntity);
        triggerExecutorIfNeeded(executableJob);
        return executableJob;
    }
    return null;
}
Also used : DeadLetterJobEntity(org.activiti.engine.impl.persistence.entity.DeadLetterJobEntity) SuspendedJobEntity(org.activiti.engine.impl.persistence.entity.SuspendedJobEntity) AbstractJobEntity(org.activiti.engine.impl.persistence.entity.AbstractJobEntity) JobEntity(org.activiti.engine.impl.persistence.entity.JobEntity) TimerJobEntity(org.activiti.engine.impl.persistence.entity.TimerJobEntity) ActivitiIllegalArgumentException(org.activiti.engine.ActivitiIllegalArgumentException)

Aggregations

DeadLetterJobEntity (org.activiti.engine.impl.persistence.entity.DeadLetterJobEntity)6 AbstractJobEntity (org.activiti.engine.impl.persistence.entity.AbstractJobEntity)3 JobEntity (org.activiti.engine.impl.persistence.entity.JobEntity)3 SuspendedJobEntity (org.activiti.engine.impl.persistence.entity.SuspendedJobEntity)3 TimerJobEntity (org.activiti.engine.impl.persistence.entity.TimerJobEntity)3 ActivitiIllegalArgumentException (org.activiti.engine.ActivitiIllegalArgumentException)2 JobNotFoundException (org.activiti.engine.JobNotFoundException)1 DeadLetterJobEntityManager (org.activiti.engine.impl.persistence.entity.DeadLetterJobEntityManager)1 JobEntityManager (org.activiti.engine.impl.persistence.entity.JobEntityManager)1 SuspendedJobEntityManager (org.activiti.engine.impl.persistence.entity.SuspendedJobEntityManager)1 TimerJobEntityManager (org.activiti.engine.impl.persistence.entity.TimerJobEntityManager)1