Jsr 352 - forcing to step regardless the status

94 Views Asked by At

I'm using jberet implementation of jsr 352.

My purpose is to provide a final step in which I send an email with batch information status.

Therefore, even if the previous step (can be either batchlet or a chunk) terminate with unexpected error, I must go through the final step and report what happened.

What is the best approach to do this? Maybe using some listeners?

1

There are 1 best solutions below

1
On BEST ANSWER

Yes, javax.batch.api.listener.JobListener#afterJob is the best place to do that. See its javadoc here.