I am trying to stop a job using a custom exit status set in a step execution listener. However, the job does not stop as expected. The job continues to execute step2 even though the step execution exit code is reported as "STOPPED_FOR_PAUSE".
Can anyone point me to what I am doing wrong? This looks like it should work based on the docs.
<job id="job2" xmlns="http://www.springframework.org/schema/batch"
<step id="step1" >
<tasklet ref="tasklet1" transaction-manager="transactionManager">
<batch:listener class="StepExecListener" />
<batch:stop on="STOPPED_FOR_PAUSE" restart="step2"/>
<tasklet ref="tasklet2" transaction-manager="transactionManager">