protected JobEntity getJob() { return Context .getCommandContext() .getJobManager() .findJobById(jobId); }
protected JobEntity getJob() { return Context .getCommandContext() .getJobManager() .findJobById(jobId); }
protected JobEntity getJob() { return Context.getCommandContext().getJobManager().findJobById(jobId); }
protected JobEntity getJob() { return Context.getCommandContext().getJobManager().findJobById(jobId); }
public Void execute(CommandContext commandContext) { JobEntity job = commandContext .getJobManager() .findJobById(jobId); if (job != null) { fireHistoricJobFailedEvt(job); cmd.execute(commandContext); } else { LOG.debugFailedJobNotFound(jobId); } return null; } });
public Void execute(CommandContext commandContext) { JobEntity job = commandContext .getJobManager() .findJobById(jobId); if (job != null) { fireHistoricJobFailedEvt(job); cmd.execute(commandContext); } else { LOG.debugFailedJobNotFound(jobId); } return null; } });
public Void execute(CommandContext commandContext) { Date currentTime = ClockUtil.getCurrentTime(); commandContext.getJobManager() .findJobById(job.getId()) .setDuedate(new Date(currentTime.getTime() - 10000)); return null; }
public Void execute(CommandContext commandContext) { JobEntity job = commandContext .getJobManager() .findJobById(jobId); if (job != null) { for(CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) { checker.checkUpdateJob(job); } job.setDuedate(newDuedate); } else { throw new ProcessEngineException("No job found with id '" + jobId + "'."); } return null; } }
public Void execute(CommandContext commandContext) { TimerEntity failedJob = (TimerEntity) commandContext .getJobManager() .findJobById(jobId); Date newDueDate = failedJob.calculateRepeat(); if (newDueDate != null) { failedJob.createNewTimerJob(newDueDate); // update configuration of failed job TimerJobConfiguration config = (TimerJobConfiguration) failedJob.getJobHandlerConfiguration(); config.setFollowUpJobCreated(true); failedJob.setJobHandlerConfiguration(config); } return null; }
public Void execute(CommandContext commandContext) { TimerEntity failedJob = (TimerEntity) commandContext .getJobManager() .findJobById(jobId); Date newDueDate = failedJob.calculateRepeat(); if (newDueDate != null) { failedJob.createNewTimerJob(newDueDate); // update configuration of failed job TimerJobConfiguration config = (TimerJobConfiguration) failedJob.getJobHandlerConfiguration(); config.setFollowUpJobCreated(true); failedJob.setJobHandlerConfiguration(config); } return null; }
public Object execute(CommandContext commandContext) { JobEntity job = commandContext.getJobManager().findJobById(jobId); if (job != null) { commandContext.getJobManager().delete(job); } return null; } });
public String execute(CommandContext commandContext) { ensureNotNull("jobId", jobId); JobEntity job = commandContext .getJobManager() .findJobById(jobId); ensureNotNull("No job found with id " + jobId, "job", job); for(CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) { checker.checkReadJob(job); } return job.getExceptionStacktrace(); }
public Void execute(CommandContext commandContext) { JobEntity job = commandContext .getJobManager() .findJobById(jobId); if (job != null) { for(CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) { checker.checkUpdateJob(job); } job.setDuedate(newDuedate); } else { throw new ProcessEngineException("No job found with id '" + jobId + "'."); } return null; } }
public String execute(CommandContext commandContext) { ensureNotNull("jobId", jobId); JobEntity job = commandContext .getJobManager() .findJobById(jobId); ensureNotNull("No job found with id " + jobId, "job", job); for(CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) { checker.checkReadJob(job); } return job.getExceptionStacktrace(); }
public Object execute(CommandContext commandContext) { JobEntity job = commandContext.getJobManager().findJobById(jobId); if (job != null) { commandContext.getJobManager().delete(job); } return null; } });
public Void execute(CommandContext commandContext) { EnsureUtil.ensureNotNull("job id must not be null", "jobId", jobId); JobEntity job = commandContext.getJobManager().findJobById(jobId); EnsureUtil.ensureNotNull(NotFoundException.class, "No job found with id '" + jobId + "'", "job", job); for(CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) { checker.checkUpdateJob(job); } long currentPriority = job.getPriority(); job.setPriority(priority); createOpLogEntry(commandContext, currentPriority, job); return null; }
public Void execute(CommandContext commandContext) { EnsureUtil.ensureNotNull("job id must not be null", "jobId", jobId); JobEntity job = commandContext.getJobManager().findJobById(jobId); EnsureUtil.ensureNotNull(NotFoundException.class, "No job found with id '" + jobId + "'", "job", job); for(CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) { checker.checkUpdateJob(job); } long currentPriority = job.getPriority(); job.setPriority(priority); createOpLogEntry(commandContext, currentPriority, job); return null; }
@Override public Object execute(CommandContext commandContext) { final JobEntity job = commandContext.getJobManager().findJobById(jobId); job.setLockOwner("someLockOwner"); job.setLockExpirationTime(DateUtils.addHours(ClockUtil.getCurrentTime(), 1)); return null; } });
public Object execute(CommandContext commandContext) { ensureNotNull("jobId", jobId); JobEntity job = commandContext.getJobManager().findJobById(jobId); ensureNotNull("No job found with id '" + jobId + "'", "job", job); for(CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) { checker.checkUpdateJob(job); } // We need to check if the job was locked, ie acquired by the job acquisition thread // This happens if the the job was already acquired, but not yet executed. // In that case, we can't allow to delete the job. if (job.getLockOwner() != null || job.getLockExpirationTime() != null) { throw new ProcessEngineException("Cannot delete job when the job is being executed. Try again later."); } job.delete(); return null; }
public Object execute(CommandContext commandContext) { ensureNotNull("jobId", jobId); JobEntity job = commandContext.getJobManager().findJobById(jobId); ensureNotNull("No job found with id '" + jobId + "'", "job", job); for(CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) { checker.checkUpdateJob(job); } // We need to check if the job was locked, ie acquired by the job acquisition thread // This happens if the the job was already acquired, but not yet executed. // In that case, we can't allow to delete the job. if (job.getLockOwner() != null || job.getLockExpirationTime() != null) { throw new ProcessEngineException("Cannot delete job when the job is being executed. Try again later."); } job.delete(); return null; }