JobEntity job = commandContext
.getJobManager()
.findJobById(jobId);
if (job == null) {
throw new JobNotFoundException(jobId);
}
JobExecutorContext jobExecutorContext = Context.getJobExecutorContext();
if(jobExecutorContext != null) { // if null, then we are not called by the job executor
jobExecutorContext.setCurrentJob(job);