code: private void transitionToFinalBatchStatus() {
  		BatchStatus currentBatchStatus = stepContext.getBatchStatus();
  		if (currentBatchStatus.equals(BatchStatus.STARTED)) {
  			updateBatchStatus(BatchStatus.COMPLETED);
  		} else if (currentBatchStatus.equals(BatchStatus.STOPPING)) {
  			updateBatchStatus(BatchStatus.STOPPED);
  		} else if (currentBatchStatus.equals(BatchStatus.FAILED)) {
  			updateBatchStatus(BatchStatus.FAILED);           // Should have already been done but maybe better for possible code refactoring to have it here.
  		} else {
  			throw new IllegalStateException("Step batch status should not be in a " + currentBatchStatus.name() + " state");
  		}
  	}
docs: The only valid states at this point are STARTED,STOPPING, or FAILED.
  been able to get to STOPPED, or COMPLETED yet at this point in the code.