I'm looking for an example how to restart and restart and clean up job in Plan using TWSz Java API. For simple restart I'm changing status of a job
plan.setJobInstanceStatus(jobInPlanList.get(0).getId(), FlowNodeInternalStatusType.FLOW_NODE_ZOSSTATUS_READY, "", null);
I don't know that this is correct way to do that? And I can;t find the way to restart and clean up, I tried to use combination:
plan.beginJobRestartCleanup
plan.executeJobRestartCleanup
plan.commitJobRestartAndCleanup
But nothing works properly.
for simple restart is ok to set job status to ready. Concerning restart and clean up, you should use the following flow: -set RestartCleanupOptions parameter that you need to pass to beginJobRestartCleanup api -modify job to be restarted, if needed -commit -handle possible exception using a try-catch block and rollbackJobRestartCleanup
Here is an example:
I hope this will be helpful.