I have a problem with JobExecutionDecider exit code when "end on" is called. I use CommandLineJobRunner inside a shell script, where do I get the exit code via $? which indicates the exit status of the called program. The problem is that whenever the JobExecutionDecider "end on" is called, the exit status is invariably set to 1 (failure). This is not the case when "end on" is called through a regular "step". In these cases, the exit code is set appropriately (i.e. 0). I tried to manually set the end of the exit code to "COMPLETED" with the same results as shown below.
Note that the solution is actually a “preliminary step” and is the first thing that the task does. In the case where a decision has been made to complete processing, the actual "steps" are not performed.
from spring-config:
< job id="jobOne" /> < decision id="myDecision" decider="myDecider"> < end on="ABORT" exit-code="COMPLETED"/> < next on="CONTINUE" to="nextStep" /> < /decision> < step id="stepOne" /> < tasklet ref="myTasklet"> ...
from the qualifier:
public FlowExecutionStatus decide(JobExecution jobEx, StepExecution arg1) { if (abortExecution()) return new FlowExecutionStatus("ABORT"); return new FlowExecutionStatus("CONTINUE"); }
Hope I have provided enough information. Any help would be greatly appreciated. Thank you
source share