Problem
I would like to emulate an Autosys AutoSys® max_exit_success
. For example, a max_exit_success=10
means that
...
I tried to change the error_state with a next_state but this did not work. Could you give me a tiphint?
Solution
You can find instructions about handling exit codes on our How to configure the handling of exit codes by jobs page.
...
Code Block |
---|
function spooler_task_after() { var rc = spooler_task.exit_code; var next_state = spooler_task.order().job_chain_node().next_state(); spooler_log.info( "INFO: Job has ended with exit code " + rc ); switch( rc ) { case 0 : break; case 1 : spooler_log.error("suspend order"); spooler_task.order().set_suspended( true ); break; case 5 : // the hierjob mussis amrequired Jobto einhave Setbacka konfiguriertsetback sein.configuration spooler_log.error("setback order"); spooler_task.order.setback(); break; case 10 : spooler_log.warn("INFO: Please check results and content, REPORT MAY BE AFFECTED"); spooler_log.info("order state changed to " + next_state); spooler_task.order.state = next_state; break; case 15 : spooler_log.warn("INFO: Please check results and content. THERE ARE REJECTS"); spooler_log.info("order state changed to " + next_state); spooler_task.order.set_state( next_state ); break; default : spooler_log.info("order state changed to " + next_state); spooler_task.order.set_state( next_state ); break; } } |
...