How to control Java batch exit status

368 Views Asked by At

I am trying to improve exit information for some JSR-352 batch job. So far I use Wildfly (and the included JBeret implementation), and my last batch step returns

  • batch status: COMPLETED
  • exit status: WARNING

However, when looking from 'outside' at the job, I see

  • batch status: COMPLETED
  • exit status: COMPLETED

How can I change the job's exit status to "WARNING"?

1

There are 1 best solutions below

2
On BEST ANSWER

You can set the job's exit status programmatically in one of your batch artifact classes, via JobContext.setExitStatus method.