Enhancement:
There should be an ability to set up final status handlers that acts based on the return code of one of the previous job(s).
In the chain editor, additional Final Status handlers should be added where a range of return codes can be provided (similar to map return code to completed (for example: -2,4,6,10-102,301-).
When no other final status handler matches and the job return code is within the range, the final status handler should kick in.
Workaround:
You can add a Post Running action, so that the process goes to kill
depending on the return code and then use the status handler of the step to execute required action when killed.
Example PostRunning Action source for process going to kill when return code is return code 2,5,6,7,8,9 and 10 ;
{
Long returnCode = jcsJob.getReturnCode();
String mapToKill = "2,5-10"; //return code 2 and 5,6,7,8,9,10 will set the job to killed
if (returnCode == null)
{
// Handle null as 0
returnCode = new Long(0);
}
// Use jcsSession.inRange to determine if the code is in range.
if (jcsSession.inRange(returnCode.intValue(), mapToKill))
{
JobNote jn = jcsJob.createJobNote();
jn.setText("Setting status to Kill as returncode "
+ jcsJob.getReturnCode()
+ " is in "
+ mapToKill);
jcsPostRunningContext.setFinalStatus(JobStatus.Killed);
}
}
Please adapt the script to your requirement and test accordingly before deploying to PROD.
Resolution:
The enhancement will be reviewed and considered.
Reference:
RCORE-45147
Comments
0 comments
Please sign in to leave a comment.