code: public RuntimeJobExecution createJobStartExecution(final WSJobInstance jobInstance,
                                                         IJobXMLSource jslSource,
                                                         Properties jobParameters,
                                                         long executionId) throws JobStartException {
  
          // TODO - redesign to avoid cast?
          final JobInstanceEntity jobInstanceImpl = (JobInstanceEntity) jobInstance;
          long instanceId = jobInstance.getInstanceId();
  
          ModelNavigator<JSLJob> navigator = createFirstExecution(jobInstanceImpl, jslSource, jobParameters);
          JobExecutionEntity jobExec = null;
          try {
              jobExec = getPersistenceManagerService().getJobExecutionMostRecent(instanceId);
              // Check to make sure the executionId belongs to the most recent execution.
              // If not, a restart may have occurred. So, fail the start.
              // Also check to make sure a stop did not come in while the start was on the queue.
              BatchStatus currentBatchStatus = jobExec.getBatchStatus();
              if (jobExec.getExecutionId() != executionId ||
                  currentBatchStatus.equals(BatchStatus.STOPPING) ||
                  currentBatchStatus.equals(BatchStatus.STOPPED)) {
                  throw new JobStartException();
              }
  
          } catch (IllegalStateException ie) {
              // If no execution exists, request came from old dispatch path.  
              jobExec = getPersistenceManagerService().createJobExecution(instanceId, jobParameters, new Date());
              BatchEventsPublisher eventsPublisher = batchKernelImpl.getBatchEventsPublisher();
              if (eventsPublisher != null) {
                  String correlationId = getCorrelationId(jobParameters);
                  eventsPublisher.publishJobExecutionEvent(jobExec, BatchEventsPublisher.TOPIC_EXECUTION_STARTING, correlationId);
              }
          }
  
          TopLevelNameInstanceExecutionInfo topLevelInfo = new TopLevelNameInstanceExecutionInfo(jobInstanceImpl.getJobName(), instanceId, jobExec.getExecutionId());
  
          return new RuntimeJobExecution(topLevelInfo, jobParameters, navigator);
      }
docs: Note: this method is called on the job submission thread.
  
  Updates the jobinstance record with the jobXML and jobname (jobid in jobxml).
  
  @return a new RuntimeJobExecution record, ready to be dispatched.