Hello,
the job has parallel executions and I get problems with an exception in one of the parallel executed Tasklets. The 'non-parallel-step' works fine. If an exception is thrown, the ExitStatus is FAILED and an email is sent. Right the way it is declared (see below).
The same implementation does not work for the parallel steps, e.g. inventory-step. If I do not mention next on="FAILED" the error message of the framework is:.Caused by: org.springframework.batch.core.job.flow.FlowExecut ionException: Next state not found in flow=processing-flow.0 for state=processing-flow.0.inventory-step with exit status=FAILED
If I declare it the same way as 'non-parallel-step' I get:when the VM starts and it fails starting completely.java.lang.IllegalArgumentException: Missing state for [StateTransition: [state=processing-flow.0.inventory-step, pattern=FAILED, next=processing-flow.0.send-email]]
How can I neatly and working configure an exception case in parallel execution with Tasklets?Code:<batch:job id="case-b-job"> <batch:step id="non-parallel-step"> <batch:tasklet ref="nonParallelTasklet" transaction-manager="jobRepositoryTransactionManager"/> <batch:next on="CONTINUABLE" to="non-parallel-step"/> <batch:next on="COMPLETED" to="processing-flow"/> <batch:next on="FAILED" to="send-email"/> </batch:step> <!-- parallel executions --> <batch:split id="processing-flow" task-executor="taskExecutor"> <batch:flow> <batch:step id="inventory-step"> <batch:tasklet ref="inventoryTasklet" transaction-manager="jobRepositoryTransactionManager"/> <batch:next on="CONTINUABLE" to="inventory-step"/> <batch:end on="FINISHED"/> <!--<batch:next on="FAILED" to="send-email"/>--> </batch:step> </batch:flow> <batch:flow> <batch:step id="amorgos-step"> <batch:tasklet ref="amorgosTasklet" transaction-manager="jobRepositoryTransactionManager"/> <batch:next on="CONTINUABLE" to="amorgos-step"/> <batch:end on="FINISHED"/> <!--<batch:next on="FAILED" to="send-email"/>--> </batch:step> </batch:flow> <batch:next on="*" to="send-email"/> <batch:end on="COMPLETED"/> </batch:split> <batch:step id="send-email"> <batch:tasklet ref="emailTasklet" transaction-manager="jobRepositoryTransactionManager"/> <batch:fail on="*" exit-code="FAILED"/> </batch:step> </batch:job>
Thanks in advance,
kieran


Reply With Quote