@Override public Transition getNextTransition(ExecutionElement currentExecutionElem, ExecutionStatus currentStatus) throws IllegalTransitionException { if (logger.isLoggable(Level.FINE)) { logger.fine("Getting next transition in job, currentExecutionElem = " + currentExecutionElem); } Transition nextTransition = getNextTransition(currentExecutionElem, job.getExecutionElements(), currentStatus); logger.fine("Got next transition in job = " + nextTransition); return nextTransition; }
@Override public Transition getNextTransition(ExecutionElement currentExecutionElem, ExecutionStatus currentStatus) throws IllegalTransitionException { if (logger.isLoggable(Level.FINE)) { logger.fine("Getting next transition in job, currentExecutionElem = " + currentExecutionElem); } Transition nextTransition = getNextTransition(currentExecutionElem, job.getExecutionElements(), currentStatus); logger.fine("Got next transition in job = " + nextTransition); return nextTransition; }
@Override public Transition getNextTransition(ExecutionElement currentExecutionElem, ExecutionStatus currentStatus) throws IllegalTransitionException { if (logger.isLoggable(Level.FINE)) { logger.fine("Getting next transition in job, currentExecutionElem = " + currentExecutionElem); } Transition nextTransition = getNextTransition(currentExecutionElem, job.getExecutionElements(), currentStatus); logger.fine("Got next transition in job = " + nextTransition); return nextTransition; }
@Override public ExecutionElement getFirstExecutionElement(String restartOn) throws IllegalTransitionException { logger.fine("Getting first execution element in job, restartOn = " + restartOn); ExecutionElement firstElem = getFirstExecutionElement(job.getExecutionElements(), restartOn); logger.fine("Got first execution element in job = " + firstElem.getId()); return firstElem; }
@Override public ExecutionElement getFirstExecutionElement(String restartOn) throws IllegalTransitionException { logger.fine("Getting first execution element in job, restartOn = " + restartOn); ExecutionElement firstElem = getFirstExecutionElement(job.getExecutionElements(), restartOn); logger.fine("Got first execution element in job = " + firstElem.getId()); return firstElem; }
@Override public ExecutionElement getFirstExecutionElement(String restartOn) throws IllegalTransitionException { logger.fine("Getting first execution element in job, restartOn = " + restartOn); ExecutionElement firstElem = getFirstExecutionElement(job.getExecutionElements(), restartOn); logger.fine("Got first execution element in job = " + firstElem.getId()); return firstElem; }
@Test public void testModelNoValidate() throws Exception { JAXBContext ctx = JAXBContext.newInstance("com.ibm.jbatch.jsl.model"); Unmarshaller u = ctx.createUnmarshaller(); FileInputStream fis = new FileInputStream(new File("test/files/valid.job1.xml")); // Use this for anonymous type //Job job = (Job)u.unmarshal(url.openStream()); // Use this for named complex type, which is what the spec uses. Object elem = u.unmarshal(fis); JSLJob job = (JSLJob)((JAXBElement)elem).getValue(); assertEquals("job1", job.getId()); assertEquals(1, job.getExecutionElements().size()); Step step = (Step)job.getExecutionElements().get(0); assertEquals("step1", step.getId()); Batchlet b = step.getBatchlet(); assertEquals("step1Ref", b.getRef()); }
public static JSLJob buildFlowInSplitSubJob(long topLevelJobInstanceId, JobContext jobContext, Split split, Flow flow) { ObjectFactory jslFactory = new ObjectFactory(); JSLJob subJob = jslFactory.createJSLJob(); // Uses the true top-level job instance id, not an internal "subjob" id. String subJobId = generateSubJobId(topLevelJobInstanceId, split.getId(), flow.getId()); subJob.setId(subJobId); //Copy all properties from parent JobContext to flow threads subJob.setProperties(CloneUtility.javaPropsTojslProperties(jobContext.getProperties())); //We don't need to do a deep copy here since each flow is already independent of all others, unlike in a partition //where one step instance can be executed with different properties on multiple threads. subJob.getExecutionElements().add(flow); return subJob; }
public static JSLJob buildFlowInSplitSubJob(Long parentJobExecutionId, JobContext jobContext, Split split, Flow flow) { ObjectFactory jslFactory = new ObjectFactory(); JSLJob subJob = jslFactory.createJSLJob(); // Set the generated subjob id String subJobId = generateSubJobId(parentJobExecutionId, split.getId(), flow.getId()); subJob.setId(subJobId); //Copy all properties from parent JobContext to flow threads subJob.setProperties(CloneUtility.javaPropsTojslProperties(jobContext.getProperties())); //We don't need to do a deep copy here since each flow is already independent of all others, unlike in a partition //where one step instance can be executed with different properties on multiple threads. subJob.getExecutionElements().add(flow); return subJob; }
@Test public void testModelValidate() throws Exception { JAXBContext ctx = JAXBContext.newInstance("com.ibm.jbatch.jsl.model"); Unmarshaller u = ctx.createUnmarshaller(); u.setSchema(ValidatorHelper.getXJCLSchema()); JSLValidationEventHandler handler = new JSLValidationEventHandler(); u.setEventHandler(handler); FileInputStream fis = new FileInputStream(new File("test/files/valid.job1.xml")); // Use this for anonymous type //Job job = (Job)u.unmarshal(url.openStream()); // Use this for named complex type, which is what the spec uses. Object elem = u.unmarshal(fis); assertFalse("XSD invalid, see sysout", handler.eventOccurred()); JSLJob job = (JSLJob)((JAXBElement)elem).getValue(); assertEquals("job1", job.getId()); assertEquals(1, job.getExecutionElements().size()); Step step = (Step)job.getExecutionElements().get(0); assertEquals("step1", step.getId()); Batchlet b = step.getBatchlet(); assertEquals("step1Ref", b.getRef()); }
jslJob.setProperties(JobDefinitionBuildUtils.buildJobProperties(scopeId, jobId, jobStartOptions)); jslJob.setListeners(JobDefinitionBuildUtils.buildListener()); jslJob.getExecutionElements().addAll(jslExecutionElements);
public static JSLJob buildFlowInSplitSubJob(JobContextImpl jobContext, Split split, Flow flow) { ObjectFactory jslFactory = new ObjectFactory(); JSLJob subJob = jslFactory.createJSLJob(); // Uses the true top-level job instance id, not an internal "subjob" id. String subJobId = generateSubJobId(jobContext.getInstanceId(), split.getId(), flow.getId()); subJob.setId(subJobId); //Copy all properties from parent JobContext to flow threads subJob.setProperties(CloneUtility.javaPropsTojslProperties(jobContext.getProperties())); //We don't need to do a deep copy here since each flow is already independent of all others, unlike in a partition //where one step instance can be executed with different properties on multiple threads. subJob.getExecutionElements().add(flow); jobContext.addTopLevelContextProperties(subJob.getProperties()); return subJob; }
jslJob.setProperties(JobDefinitionBuildUtils.buildJobProperties(scopeId, jobId, jobStartOptions)); jslJob.setListeners(JobDefinitionBuildUtils.buildListener()); jslJob.getExecutionElements().addAll(jslExecutionElements);
subJob.getExecutionElements().add(newStep);
for (final ExecutionElement next : job.getExecutionElements()) { if (next instanceof Step) { PropertyResolverFactory.createStepPropertyResolver(this.isPartitionedStep).substituteProperties((Step)next, submittedProps, currentProps);
subJob.getExecutionElements().add(newStep);
for (final ExecutionElement next : job.getExecutionElements()) { if (next instanceof Step) { PropertyResolverFactory.createStepPropertyResolver(this.isPartitionedStep).substituteProperties((Step)next, submittedProps, currentProps);
for (final ExecutionElement next : job.getExecutionElements()) { if (next instanceof Step) { PropertyResolverFactory.createStepPropertyResolver(this.isPartitionedStep).substituteProperties((Step)next, submittedProps, currentProps);
subJob.getExecutionElements().add(newStep);