@param appName
@param jobXMLName

@return newly created JobInstance (Note: job instance must be started separately)

Note: Inline JSL takes precedence over JSL within .war
321380
@Override
    public WSJobInstance createJobInstance(String appName, String jobXMLName, String jsl, String correlationId) {

        if (authService != null) {
            authService.authorizedJobSubmission();
        }

        return batchKernelService.createJobInstance(appName, jobXMLName, batchSecurityHelper.getRunAsUser(), jsl, correlationId);

    }
897298
@Override
	public IJobXMLSource loadJSL(String id) {

		IJobXMLSource jobXML = loadJobFromDirectory(JOB_XML_PATH, id);

		return jobXML;
	}
856810
public static String newJobId(String jobName) {
    return Id.Job.create(jobName, System.currentTimeMillis()).toString();
  }
753558
public static JobBuilder newJobBuilder(Class<? extends Job> jobClass) {

    JobBuilder b = new JobBuilder();
    b.ofType(jobClass);
    return b;
  }
979494
@Override
	public RuntimeJobExecution createJobExecution(JobInstance jobInstance, Properties jobParameters, BatchStatus batchStatus) {
		Timestamp now = new Timestamp(System.currentTimeMillis());
		long newExecutionId = createRuntimeJobExecutionEntry(jobInstance, jobParameters, batchStatus, now);
		RuntimeJobExecution jobExecution = new RuntimeJobExecution(jobInstance, newExecutionId);
		jobExecution.setBatchStatus(batchStatus.name());
		jobExecution.setCreateTime(now);
		jobExecution.setLastUpdateTime(now);
		return jobExecution;
	}
848415
public static void addJob(
      String jobName,
      Class<? extends Job> jobClass,
      Map<String, Object> params,
      boolean isConcurrencyAllowed)
      throws SundialSchedulerException {

    try {
      JobDataMap jobDataMap = new JobDataMap();
      if (params != null) {
        for (Entry<String, Object> entry : params.entrySet()) {
          jobDataMap.put(entry.getKey(), entry.getValue());
        }
      }

      JobDetail jobDetail =
          newJobBuilder(jobClass)
              .withIdentity(jobName)
              .usingJobData(jobDataMap)
              .isConcurrencyAllowed(isConcurrencyAllowed)
              .build();

      getScheduler().addJob(jobDetail);

    } catch (SchedulerException e) {
      logger.error("ERROR ADDING JOB!!!", e);
      throw new SundialSchedulerException("ERROR ADDING JOB!!!", e);
    }
  }
358429
public EngineResult createNewJob(String jobname) {
        HttpPost postRequest = new HttpPost(baseUrl);
        List<NameValuePair> nvp = new LinkedList<NameValuePair>();
        nvp.add(new BasicNameValuePair("action", "create"));
        nvp.add(new BasicNameValuePair("createpath", jobname));
        StringEntity postEntity = null;
        try {
            postEntity = new UrlEncodedFormEntity(nvp);
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        postEntity.setContentType("application/x-www-form-urlencoded");
        postRequest.addHeader("Accept", "application/xml");
        postRequest.setEntity(postEntity);
        return engineResult(postRequest);
    }
845468
public Job createJob(String query) {
    // [START ]
    Job job = null;
    JobConfiguration jobConfiguration = QueryJobConfiguration.of(query);
    JobInfo jobInfo = JobInfo.of(jobConfiguration);
    try {
      job = bigquery.create(jobInfo);
    } catch (BigQueryException e) {
      // the job was not created
    }
    // [END ]
    return job;
  }
35321
@Override
	public JobExecutionResult execute(String jobName) throws Exception {
		Plan p = createProgramPlan(jobName);
		
		PlanExecutor executor = PlanExecutor.createLocalExecutor();
		initLogging();
		return executor.executePlan(p);
	}
330747
public Flow<JobXMLDescriptor> getOrCreateFlow()
   {
      List<Node> nodeList = model.get("flow");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new FlowImpl<JobXMLDescriptor>(this, "flow", model, nodeList.get(0));
      }
      return createFlow();
   }
1141056
@Override
  String getAppIdFromJobName(String jobName) {
    int firstOpenBracketPos = jobName.indexOf("[");
    if (firstOpenBracketPos > -1) {
      return jobName.substring(0, firstOpenBracketPos);
    }
    return jobName;
  }
167995
@Override
	public JobStatus createJobStatus(long jobInstanceId) {
		logger.entering(CLASSNAME, "createJobStatus", jobInstanceId);
		Connection conn = null;
		PreparedStatement statement = null;
		JobStatus jobStatus = new JobStatus(jobInstanceId);
		try {
			conn = getConnection();
			statement = conn.prepareStatement("INSERT INTO jobstatus (id, obj) VALUES(?, ?)");
			statement.setLong(1, jobInstanceId);
			statement.setBytes(2, serializeObject(jobStatus));
			statement.executeUpdate();

		} catch (SQLException e) {
			throw new PersistenceException(e);
		} catch (IOException e) {
			throw new PersistenceException(e);
		} finally {
			cleanupConnection(conn, null, statement);
		}
		logger.exiting(CLASSNAME, "createJobStatus");
		return jobStatus;
	}
257571
public JobRequest setApplicationName(String applicationName)
    {
        if (applicationName == null || applicationName.length() > 100)
        {
            throw new JqmInvalidRequestException("Job definition name must be between 1 and 100 characters");
        }
        this.applicationName = applicationName;
        return this;
    }
693814
public static DefaultJobSpecScheduleImpl createImmediateSchedule(JobSpec jobSpec,
                                                                   Runnable jobRunnable) {
    return new DefaultJobSpecScheduleImpl(jobSpec, jobRunnable,
                                          Optional.of(System.currentTimeMillis()));
  }
452113
@Bean
  public JobFactory<MappingJobExecution> mappingJobFactory() {
    return new JobFactory<MappingJobExecution>() {
      @Override
      public Job createJob(MappingJobExecution mappingJobExecution) {
        final String mappingProjectId = mappingJobExecution.getMappingProjectId();
        final String targetEntityTypeId = mappingJobExecution.getTargetEntityTypeId();
        final String packageId = mappingJobExecution.getPackageId();
        final String label = mappingJobExecution.getLabel();
        final Boolean addSourceAttribute = mappingJobExecution.isAddSourceAttribute();
        final String resultUrl =
            menuReaderService.findMenuItemPath(DataExplorerController.ID)
                + "?entity="
                + targetEntityTypeId;
        mappingJobExecution.setResultUrl(resultUrl);
        return progress ->
            mappingService.applyMappings(
                mappingProjectId,
                targetEntityTypeId,
                addSourceAttribute,
                packageId,
                label,
                progress);
      }
    };
  }
1237960
public Job getJobFromId(String jobName) {
    // [START ]
    JobId jobIdObject = JobId.of(jobName);
    Job job = bigquery.getJob(jobIdObject);
    if (job == null) {
      // job was not found
    }
    // [END ]
    return job;
  }
441634
private GobblinHelixJobScheduler buildGobblinHelixJobScheduler(Config config, Path appWorkDir,
      List<? extends Tag<?>> metadataTags, SchedulerService schedulerService) throws Exception {
    Properties properties = ConfigUtils.configToProperties(config);
    return new GobblinHelixJobScheduler(properties,
        this.multiManager.getJobClusterHelixManager(),
        this.multiManager.getTaskDriverHelixManager(),
        this.eventBus,
        appWorkDir,
        metadataTags,
        schedulerService,
        this.jobCatalog);
  }