.getCurrentProgress(jobExecutionId));
} else {
jobStatus.setProgress(mainJobExecutionStatusHolder
.getCurrentProgress(jobExecutionId));
}
Status status = null;
switch (jobExecution.getStatus()) {
case ABANDONED:
status = Status.ABANDONED;
break;
case COMPLETED:
status = Status.COMPLETED;
break;
case FAILED:
status = Status.FAILED;
break;
case STARTED:
status = Status.STARTED;
break;
case STARTING:
status = Status.STARTING;
break;
case STOPPED:
status = Status.STOPPED;
break;
case STOPPING:
status = Status.STOPPING;
break;
case UNKNOWN:
default:
status = Status.UNKNOWN;
}
jobStatus.setStatus(status);
if (subJobEnabled == 1) {
List<NodeOperationStatus> succeedNodes =
(ArrayList<NodeOperationStatus>) jobExecution.getExecutionContext()
.get(JobConstants.SUB_JOB_NODES_SUCCEED);
List<NodeOperationStatus> failNodes =
(ArrayList<NodeOperationStatus>) jobExecution.getExecutionContext()
.get(JobConstants.SUB_JOB_NODES_FAIL);
if (succeedNodes != null) {
jobStatus.setSucceedNodes(convert(succeedNodes));
}
if (failNodes != null) {
jobStatus.setFailNodes(convert(failNodes));
}
}
if (status.equals(Status.FAILED) && subJobEnabled != 1) {
String workDir =
TrackableTasklet.getFromJobExecutionContext(
jobExecution.getExecutionContext(),
JobConstants.CURRENT_COMMAND_WORK_DIR, String.class);
String errorMessage =