|
You can launch the job and catch JobInstanceAlreadyComplete. I think that's good enough for me. If you need a flag you can write a wrapper for the JobLauncher that does the catch and takes whatever action you need (it would depend on the specific situation).
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
My original suggestion was to make it a non-binary flag, i.e. something to the effect of
restartable=always|never|create
i.e.
- always=always restart if possible
- incompleteOnly=only restart if the job is incomplete (equivalent of allowRestartIfComplete=false)
- never=never restart and throw exception if restart conditions occur (i.e. if job name / job parameters match incomplete execution)
- create=create a new instance automatically if restart conditions occur (also would account for case where restartable job has no arguments)
Or something like that - I still think there's value to this.