private void setInJobContext(ExtendedBatchStatus flowBatchStatus, String exitStatus, String restartOn) { if (exitStatus != null) { jobContext.setExitStatus(exitStatus); } if (ExtendedBatchStatus.JSL_STOP.equals(flowBatchStatus)) { if (restartOn != null) { jobContext.setRestartOn(restartOn); } } }
private void setInJobContext(ExtendedBatchStatus flowBatchStatus, String exitStatus, String restartOn) { if (exitStatus != null) { jobContext.setExitStatus(exitStatus); } if (ExtendedBatchStatus.JSL_STOP.equals(flowBatchStatus)) { if (restartOn != null) { jobContext.setRestartOn(restartOn); } } }
jobContext.setExitStatus(exitStatusFromJSL); retVal.setExitStatus(exitStatusFromJSL); retVal = new ExecutionStatus(ExtendedBatchStatus.JSL_END); if (exitStatusFromJSL != null) { jobContext.setExitStatus(exitStatusFromJSL); retVal.setExitStatus(exitStatusFromJSL); retVal = new ExecutionStatus(ExtendedBatchStatus.JSL_FAIL); if (exitStatusFromJSL != null) { jobContext.setExitStatus(exitStatusFromJSL); retVal.setExitStatus(exitStatusFromJSL);
jobContext.setExitStatus(exitStatusFromJSL); retVal.setExitStatus(exitStatusFromJSL); retVal = new ExecutionStatus(ExtendedBatchStatus.JSL_END); if (exitStatusFromJSL != null) { jobContext.setExitStatus(exitStatusFromJSL); retVal.setExitStatus(exitStatusFromJSL); retVal = new ExecutionStatus(ExtendedBatchStatus.JSL_FAIL); if (exitStatusFromJSL != null) { jobContext.setExitStatus(exitStatusFromJSL); retVal.setExitStatus(exitStatusFromJSL);
protected void endOfJob() { // 1. Execute the very last artifacts (jobListener) try { jobListenersAfterJob(); } catch (Throwable t) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); t.printStackTrace(pw); logger.warning("Error invoking jobListener.afterJob(). Stack trace: " + sw.toString()); batchStatusFailedFromException(); } // 2. transition to final batch status transitionToFinalBatchStatus(); // 3. default ExitStatus if necessary if (jobContext.getExitStatus() == null) { logger.fine("No job-level exitStatus set, defaulting to job batch Status = " + jobContext.getBatchStatus()); jobContext.setExitStatus(jobContext.getBatchStatus().name()); } // 4. persist statuses and end time data logger.fine("Job complete for job id=" + jobExecution.getJobInstance().getJobName() + ", executionId=" + jobExecution.getExecutionId() + ", batchStatus=" + jobContext.getBatchStatus() + ", exitStatus=" + jobContext.getExitStatus()); persistJobBatchAndExitStatus(); }
protected void endOfJob() { // 1. Execute the very last artifacts (jobListener) try { jobListenersAfterJob(); } catch (Throwable t) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); t.printStackTrace(pw); logger.warning("Error invoking jobListener.afterJob(). Stack trace: " + sw.toString()); batchStatusFailedFromException(); } // 2. transition to final batch status transitionToFinalBatchStatus(); // 3. default ExitStatus if necessary if (jobContext.getExitStatus() == null) { logger.fine("No job-level exitStatus set, defaulting to job batch Status = " + jobContext.getBatchStatus()); jobContext.setExitStatus(jobContext.getBatchStatus().name()); } // 4. persist statuses and end time data logger.fine("Job complete for job id=" + jobExecution.getJobInstance().getJobName() + ", executionId=" + jobExecution.getExecutionId() + ", batchStatus=" + jobContext.getBatchStatus() + ", exitStatus=" + jobContext.getExitStatus()); persistJobBatchAndExitStatus(); }
@Override public ExecutionStatus execute() { String deciderId = decision.getRef(); List<Property> propList = (decision.getProperties() == null) ? null : decision.getProperties().getPropertyList(); DeciderProxy deciderProxy; //Create a decider proxy and inject the associated properties /* Set the contexts associated with this scope */ //job context is always in scope //the parent controller will only pass one valid context to a decision controller //so two of these contexts will always be null InjectionReferences injectionRef = new InjectionReferences(jobExecution.getJobContext(), null, propList); try { deciderProxy = ProxyFactory.createDeciderProxy(deciderId,injectionRef ); } catch (ArtifactValidationException e) { throw new BatchContainerServiceException("Cannot create the decider [" + deciderId + "]", e); } String exitStatus = deciderProxy.decide(this.previousStepExecutions); logger.fine("Decider exiting and setting job-level exit status to " + exitStatus); //Set the value returned from the decider as the job context exit status. this.jobExecution.getJobContext().setExitStatus(exitStatus); return new ExecutionStatus(ExtendedBatchStatus.NORMAL_COMPLETION, exitStatus); }
@Override public ExecutionStatus execute() { String deciderId = decision.getRef(); List<Property> propList = (decision.getProperties() == null) ? null : decision.getProperties().getPropertyList(); DeciderProxy deciderProxy; //Create a decider proxy and inject the associated properties /* Set the contexts associated with this scope */ //job context is always in scope //the parent controller will only pass one valid context to a decision controller //so two of these contexts will always be null InjectionReferences injectionRef = new InjectionReferences(jobExecution.getJobContext(), null, propList); try { deciderProxy = ProxyFactory.createDeciderProxy(deciderId,injectionRef ); } catch (ArtifactValidationException e) { throw new BatchContainerServiceException("Cannot create the decider [" + deciderId + "]", e); } String exitStatus = deciderProxy.decide(this.previousStepExecutions); logger.fine("Decider exiting and setting job-level exit status to " + exitStatus); //Set the value returned from the decider as the job context exit status. this.jobExecution.getJobContext().setExitStatus(exitStatus); return new ExecutionStatus(ExtendedBatchStatus.NORMAL_COMPLETION, exitStatus); }