new JobParameter(failStatus.name()));
//enable sub job indicator to for job progress query
mainJobParams.put(JobConstants.SUB_JOB_ENABLED, new JobParameter(1l));
Job subJob = jobRegistry.getJob(subJobName);
for (int stepNumber = 0, j = subJobParameters.size(); stepNumber < j; stepNumber++) {
SubJobStep subJobStep = new SubJobStep();
subJobStep.setName(subJobName + "-subJobStep-" + stepNumber);
subJobStep.setJob(subJob);
subJobStep.setJobParametersExtractor(jobParametersExtractor);
subJobStep.setJobExecutionStatusHolder(jobExecutionStatusHolder);
subJobStep
.setMainJobExecutionStatusHolder(mainJobExecutionStatusHolder);
subJobStep.setJobLauncher(jobLauncher);
subJobStep.setJobRepository(jobRepository);
subJobStep.setStepExecutionListeners(jobStepListeners);
subJobStep.afterPropertiesSet();
mainJob.addStep(subJobStep);
logger.debug("added sub job step: " + subJobStep.getName());
int subJobParametersNumber =
subJobParameters.get(stepNumber).getParameters().keySet().size();
mainJobParams.put(JobConstants.SUB_JOB_PARAMETERS_NUMBER + stepNumber,
new JobParameter((long) subJobParametersNumber));
int count = 0;