I have a (very simple) java batch job in JDL with just two steps.
When the step "download" return the status "STOPPED" the job should stop. After restart the stop notify should be called.
Without the partition everything works fine.
stats without partition
after step=download batchStatus=COMPLETED exitStatus=STOPPED
after job=job batchStatus=STOPPED exitStatus=STOPPED
With partition i get realy strange stati for batch end exit. And the job doesn't stop if the download step returns "STOPPED". Even if the partition has just one thread and one partition.
When trying to restart the following error is raised (of course). JBERET000609: Job execution 1 has already completed and cannot be restarted.
stats with partition
after step=download batchStatus=STARTED exitStatus=null
after job=job batchStatus=COMPLETED exitStatus=COMPLETED
job descrition
<job id="job" xmlns="http://xmlns.jcp.org/xml/ns/javaee" version="1.0" restartable="true">
<step id="download" next="notify">
<batchlet ref="downloadBatchlet">
</batchlet>
<partition>
<mapper ref="basicPartition" />
</partition>
<stop on="STOPPED" restart="notify"/>
</step>
<step id="notify">
<batchlet ref="notifyBatchlet"></batchlet>
<end on="COMPLETED"/>
</step>
</job>
Every hint an suggestions are welcome. What I am missing?
Without partition
On job start the job calls the - downloadBatchlet => STOPPED and stopps.
On restart the job calls the - notifyBatchlet => COMPLETED and ends.
With partition
On job start the job calls the - downloadBatchlet => STOPPED and stopps.
On restart the job calls NO STEPS and ends.
@Named
public class DownloadBatchlet extends AbstractBatchlet {
@Override
public String process() throws Exception {
return BatchStatus.STOPPED.toString();
}
@Override
public void stop() throws Exception {
}
}