Reputation: 4491
I'm using Batch Processing, and I assumed that if a step fails then the next wouldn't be executed but that doesn't seem to be the case. So how can I get that behaviour?
This is part of my batch file:
<?xml version="1.0" encoding="UTF-8"?>
<job id="review-job" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/jobXML_1_0.xsd" version="1.0">
<step id="step0" next="step1" >
<batchlet ref="startProcessBatchlet">
<properties>
<property name="nextQueue" value="jms/step1" />
</properties>
</batchlet>
</step>
<step id="step1" next="step2" >
<batchlet ref="validClientBatchlet">
<properties>
<property name="myQueue" value="jms/step1" />
<property name="nextQueue" value="jms/step2" />
</properties>
</batchlet>
</step>
</job>
If any step fails it should stop executing and mark the batch as failed.
Upvotes: 1
Views: 927
Reputation: 43
JSR 352 has end on clause if the job needs to fail on step failure.
Add the below statement to the jsl definition.
<end on="FAILED"/>
Thanks, Sandy
Upvotes: 1