Example #1
0
 private static InternalTask createTask(Job userJob, ScriptTask task) throws JobCreationException {
   InternalTask scriptTask;
   if (isForkingTask()) {
     scriptTask = new InternalForkedScriptTask(new ScriptExecutableContainer(task.getScript()));
     configureRunAsMe(task);
   } else {
     scriptTask = new InternalScriptTask(new ScriptExecutableContainer(task.getScript()));
   }
   // set task common properties
   try {
     setTaskCommonProperties(userJob, task, scriptTask);
   } catch (Exception e) {
     throw new JobCreationException(e);
   }
   return scriptTask;
 }
 private Element createScriptExecutableElement(Document doc, ScriptTask t) {
   Element scriptExecE =
       doc.createElementNS(
           Schemas.SCHEMA_LATEST.namespace, XMLTags.SCRIPT_EXECUTABLE.getXMLName());
   Element scriptE = createScriptElement(doc, t.getScript());
   scriptExecE.appendChild(scriptE);
   return scriptExecE;
 }