Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Complete
    • Affects Version/s: 4.0.1
    • Fix Version/s: 4.1.0, 4.1.0.M3
    • Component/s: Core
    • Labels:
      None

      Description

      The following method is named as "getStartable". "getStartable" is prone to obtain something. "isStartable" is a query asking whether the stepExecution is startable, which describes what the method is doning. So, "isStartable" should be more intuitive.

          protected boolean getStartable(StepExecution stepExecution, ExecutionContext context) throws JobExecutionException {
       
       		JobInstance jobInstance = stepExecution.getJobExecution().getJobInstance();
       		String stepName = stepExecution.getStepName();
       		StepExecution lastStepExecution = jobRepository.getLastStepExecution(jobInstance, stepName);
       
       		boolean isRestart = (lastStepExecution != null && lastStepExecution.getStatus() != BatchStatus.COMPLETED);
       
       		if (isRestart) {
       			stepExecution.setExecutionContext(lastStepExecution.getExecutionContext());
       		}
       		else {
       			stepExecution.setExecutionContext(context);
       		}
       
       		return shouldStart(allowStartIfComplete, stepExecution, lastStepExecution) || isRestart;
       
       	}
      

       

        Attachments

          Activity

            People

            • Assignee:
              mbenhassine Mahmoud Ben Hassine
              Reporter:
              Bruce Liu Kui Liu
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: