protected int createStepInstancesForJob(String jobId,Map<String,String> parameters){
  int stepInstancesCreatedCount=0;
  Job job=jobs.getJobById(jobId);
  final Map<Step,List<StepInstance>> stepToStepInstances=new HashMap<>();
  for (  Step step : job.getSteps()) {
    stepInstancesCreatedCount++;
    StepInstance stepInstance=new StepInstance(step);
    stepInstance.addParameters(parameters);
    List<StepInstance> mappedStepInstance=stepToStepInstances.get(step);
    if (mappedStepInstance == null) {
      mappedStepInstance=new ArrayList<>();
      stepToStepInstances.put(step,mappedStepInstance);
    }
    mappedStepInstance.add(stepInstance);
  }
  addDependenciesAndStore(stepToStepInstances);
  return stepInstancesCreatedCount;
}

protected int createStepInstancesForJob ( String jobId , Map < String , String > parameters ) { int stepInstancesCreatedCount = 0 ; Job job = jobs . getJobById ( jobId ) ; final Map < Step , List < StepInstance > > stepToStepInstances = new HashMap < > ( ) ; for ( Step step : job . getSteps ( ) ) { stepInstancesCreatedCount ++ ; StepInstance stepInstance = new StepInstance ( step ) ; stepInstance . addParameters ( parameters ) ; List < StepInstance > mappedStepInstance = stepToStepInstances . get ( step ) ; if ( mappedStepInstance == null ) { mappedStepInstance = new ArrayList < > ( ) ; stepToStepInstances . put ( step , mappedStepInstance ) ; } mappedStepInstance . add ( stepInstance ) ; } addDependenciesAndStore ( stepToStepInstances ) ; return stepInstancesCreatedCount ; }
this method creates the required step instances for the specified job and set of parameters , returning the number of stepinstances created .
