-
1. Re: Job Run tables and 3rd party Scheduler
cfang Aug 31, 2016 8:48 PM (in response to richardmoore)For a restart after a failed job execution, JBeret automatically restarts from the previous failed job element. However, step has an attribute "allow-start-if-complete", if set to true, the restart after a failed execution will still run these completed steps, even though they appear before the failed step in job.xml. This may be something you want to leverage.
For a restart after a stopped job execution, user can set the restart position in job.xml.
The restart position is stored in JOB_EXECUTION table as column RESTARTPOSITION, in the job repository db. I don't think you should need to change the job execution data in job repository.
If you want to dynamically set the restart position for a restart after a failed job execution, you can try some JBeret internal api (not stable and not recommented) to modify the internal restartPosition value.
If you know where to restart when a step fails, use a job listener, whose afterJob method calls org.jberet.runtime.JobExecutionImpl#setRestartPosition
If you know where to restart at restart time, use a job listener, whose beforeJob method calls
org.jberet.runtime.JobExecutionImpl#setRestartPosition. The desired restartPosition may be passed in as restart job param.
You can access JobExecutionImpl by injecting JobContext, cast it to JobContextImpl, and jobContextImpl.getJobExecution().
-
2. Re: Job Run tables and 3rd party Scheduler
richardmoore Sep 1, 2016 8:54 AM (in response to cfang)I really appreciate the help you and James have given me in implementing JBeret.
-
3. Re: Job Run tables and 3rd party Scheduler
cfang Sep 1, 2016 1:08 PM (in response to richardmoore)you're welcome. It could be a useful feature in JBeret to support custom restart position in a portable way without relying on JBeret internal methods.
-
4. Re: Job Run tables and 3rd party Scheduler
cfang Sep 12, 2016 11:52 AM (in response to cfang)Support custom restart step/position
this issue has been fixed and included in JBeret 1.3.0.Beta3 release.