@Override public FlowExecutionStatus handle(FlowExecutor executor) throws Exception { return decider.decide(executor.getJobExecution(), executor.getStepExecution()); }
@Override public FlowExecutionStatus handle(FlowExecutor executor) throws Exception { FlowExecutionStatus result = super.handle(executor); executor.getJobExecution().getExecutionContext().put("batch.lastSteps", Collections.singletonList(getStep().getName())); return result; } }
/** * Resets the {@link JobExecution}'s exit status before aggregating the results of the flows within * the split. * * @param results the {@link FlowExecution}s from each of the flows executed within this split * @param executor the {@link FlowExecutor} used to execute the flows */ @Override protected FlowExecutionStatus doAggregation(Collection<FlowExecution> results, FlowExecutor executor) { List<String> stepNames = new ArrayList<>(); for (Flow curFlow : getFlows()) { JsrFlow flow = (JsrFlow) curFlow; if(flow.getMostRecentStepName() != null) { stepNames.add(flow.getMostRecentStepName()); } } if(!stepNames.isEmpty()) { executor.getJobExecution().getExecutionContext().put("batch.lastSteps", stepNames); } executor.getJobExecution().setExitStatus(null); return super.doAggregation(results, executor); } }
@Override public FlowExecutionStatus handle(FlowExecutor executor) throws Exception { JobExecution jobExecution = executor.getJobExecution(); jobExecution.createStepExecution(getName()); if (fail) { return FlowExecutionStatus.FAILED; } else { return FlowExecutionStatus.COMPLETED; } } };
@Override public FlowExecutionStatus handle(FlowExecutor executor) throws Exception { JobExecution jobExecution = executor.getJobExecution(); if (jobExecution != null) { jobExecution.createStepExecution(getName()); } return this.status; }
@Override public FlowExecutionStatus handle(FlowExecutor executor) throws Exception { JobExecution jobExecution = executor.getJobExecution(); StepExecution stepExecution = jobExecution.createStepExecution(getName()); jobRepository.add(stepExecution); if (fail) { return FlowExecutionStatus.FAILED; } else { return FlowExecutionStatus.COMPLETED; } } };
/** * Delegate to the flow provided for the execution of the step. * * @see AbstractStep#doExecute(StepExecution) */ @Override protected void doExecute(StepExecution stepExecution) throws Exception { try { stepExecution.getExecutionContext().put(STEP_TYPE_KEY, this.getClass().getName()); StepHandler stepHandler = new SimpleStepHandler(getJobRepository(), stepExecution.getExecutionContext()); FlowExecutor executor = new JobFlowExecutor(getJobRepository(), stepHandler, stepExecution.getJobExecution()); executor.updateJobExecutionStatus(flow.start(executor).getStatus()); stepExecution.upgradeStatus(executor.getJobExecution().getStatus()); stepExecution.setExitStatus(executor.getJobExecution().getExitStatus()); } catch (FlowExecutionException e) { if (e.getCause() instanceof JobExecutionException) { throw (JobExecutionException) e.getCause(); } throw new JobExecutionException("Flow execution ended unexpectedly", e); } }
@Override public FlowExecutionStatus handle(FlowExecutor executor) throws Exception { return decider.decide(executor.getJobExecution(), executor.getStepExecution()); }
@Override public FlowExecutionStatus handle(FlowExecutor executor) throws Exception { return decider.decide(executor.getJobExecution(), executor.getStepExecution()); }
@Override public FlowExecutionStatus handle(FlowExecutor executor) throws Exception { return decider.decide(executor.getJobExecution(), executor.getStepExecution()); }
@Override public FlowExecutionStatus handle(FlowExecutor executor) throws Exception { return decider.decide(executor.getJobExecution(), executor.getStepExecution()); }
/** * Resets the {@link JobExecution}'s exit status before aggregating the results of the flows within * the split. * * @param results the {@link FlowExecution}s from each of the flows executed within this split * @param executor the {@link FlowExecutor} used to execute the flows */ @Override protected FlowExecutionStatus doAggregation(Collection<FlowExecution> results, FlowExecutor executor) { List<String> stepNames = new ArrayList<String>(); for (Flow curFlow : getFlows()) { JsrFlow flow = (JsrFlow) curFlow; if(flow.getMostRecentStepName() != null) { stepNames.add(flow.getMostRecentStepName()); } } if(!stepNames.isEmpty()) { executor.getJobExecution().getExecutionContext().put("batch.lastSteps", stepNames); } executor.getJobExecution().setExitStatus(null); return super.doAggregation(results, executor); } }
/** * Resets the {@link JobExecution}'s exit status before aggregating the results of the flows within * the split. * * @param results the {@link FlowExecution}s from each of the flows executed within this split * @param executor the {@link FlowExecutor} used to execute the flows */ @Override protected FlowExecutionStatus doAggregation(Collection<FlowExecution> results, FlowExecutor executor) { List<String> stepNames = new ArrayList<String>(); for (Flow curFlow : getFlows()) { JsrFlow flow = (JsrFlow) curFlow; if(flow.getMostRecentStepName() != null) { stepNames.add(flow.getMostRecentStepName()); } } if(!stepNames.isEmpty()) { executor.getJobExecution().getExecutionContext().put("batch.lastSteps", stepNames); } executor.getJobExecution().setExitStatus(null); return super.doAggregation(results, executor); } }
@Override public FlowExecutionStatus handle(FlowExecutor executor) throws Exception { FlowExecutionStatus result = super.handle(executor); executor.getJobExecution().getExecutionContext().put("batch.lastSteps", Collections.singletonList(getStep().getName())); return result; } }
@Override public FlowExecutionStatus handle(FlowExecutor executor) throws Exception { FlowExecutionStatus result = super.handle(executor); executor.getJobExecution().getExecutionContext().put("batch.lastSteps", Collections.singletonList(getStep().getName())); return result; } }
@Override public FlowExecutionStatus handle(FlowExecutor executor) throws Exception { FlowExecutionStatus result = super.handle(executor); executor.getJobExecution().getExecutionContext().put("batch.lastSteps", Collections.singletonList(getStep().getName())); return result; } }
/** * Delegate to the flow provided for the execution of the step. * * @see AbstractStep#doExecute(StepExecution) */ @Override protected void doExecute(StepExecution stepExecution) throws Exception { try { stepExecution.getExecutionContext().put(STEP_TYPE_KEY, this.getClass().getName()); StepHandler stepHandler = new SimpleStepHandler(getJobRepository(), stepExecution.getExecutionContext()); FlowExecutor executor = new JobFlowExecutor(getJobRepository(), stepHandler, stepExecution.getJobExecution()); executor.updateJobExecutionStatus(flow.start(executor).getStatus()); stepExecution.upgradeStatus(executor.getJobExecution().getStatus()); stepExecution.setExitStatus(executor.getJobExecution().getExitStatus()); } catch (FlowExecutionException e) { if (e.getCause() instanceof JobExecutionException) { throw (JobExecutionException) e.getCause(); } throw new JobExecutionException("Flow execution ended unexpectedly", e); } }
/** * Delegate to the flow provided for the execution of the step. * * @see AbstractStep#doExecute(StepExecution) */ @Override protected void doExecute(StepExecution stepExecution) throws Exception { try { stepExecution.getExecutionContext().put(STEP_TYPE_KEY, this.getClass().getName()); StepHandler stepHandler = new SimpleStepHandler(getJobRepository(), stepExecution.getExecutionContext()); FlowExecutor executor = new JobFlowExecutor(getJobRepository(), stepHandler, stepExecution.getJobExecution()); executor.updateJobExecutionStatus(flow.start(executor).getStatus()); stepExecution.upgradeStatus(executor.getJobExecution().getStatus()); stepExecution.setExitStatus(executor.getJobExecution().getExitStatus()); } catch (FlowExecutionException e) { if (e.getCause() instanceof JobExecutionException) { throw (JobExecutionException) e.getCause(); } throw new JobExecutionException("Flow execution ended unexpectedly", e); } }
/** * Delegate to the flow provided for the execution of the step. * * @see AbstractStep#doExecute(StepExecution) */ @Override protected void doExecute(StepExecution stepExecution) throws Exception { try { StepHandler stepHandler = new SimpleStepHandler(getJobRepository(), stepExecution.getExecutionContext()); FlowExecutor executor = new JobFlowExecutor(getJobRepository(), stepHandler, stepExecution.getJobExecution()); executor.updateJobExecutionStatus(flow.start(executor).getStatus()); stepExecution.upgradeStatus(executor.getJobExecution().getStatus()); stepExecution.setExitStatus(executor.getJobExecution().getExitStatus()); } catch (FlowExecutionException e) { if (e.getCause() instanceof JobExecutionException) { throw (JobExecutionException) e.getCause(); } throw new JobExecutionException("Flow execution ended unexpectedly", e); } }
/** * Delegate to the flow provided for the execution of the step. * * @see AbstractStep#doExecute(StepExecution) */ @Override protected void doExecute(StepExecution stepExecution) throws Exception { try { StepHandler stepHandler = new SimpleStepHandler(getJobRepository(), stepExecution.getExecutionContext()); FlowExecutor executor = new JobFlowExecutor(getJobRepository(), stepHandler, stepExecution.getJobExecution()); executor.updateJobExecutionStatus(flow.start(executor).getStatus()); stepExecution.upgradeStatus(executor.getJobExecution().getStatus()); stepExecution.setExitStatus(executor.getJobExecution().getExitStatus()); } catch (FlowExecutionException e) { if (e.getCause() instanceof JobExecutionException) { throw (JobExecutionException) e.getCause(); } throw new JobExecutionException("Flow execution ended unexpectedly", e); } }