...
Code Block | ||
---|---|---|
| ||
<?xml version="1.0" encoding="ISO-8859-1"?>
<job order="yes" stop_on_error="no">
<script language="javax.script:ecmascript">
<![CDATA[
function spooler_process(){
var today = new Date();
var day_of_month = today.getDate();
if (day_of_month == 12){
spooler_log.info("Today is the 12th - skipping job chain b");
spooler_task.order().set_state("end_of_chain_b");
}
return true;
}
]]>
</script>
<run_time />
</job> |
...
The change to the order state carried out by the set_state() causes JobScheduler to go to the end state of the current (in this case, the middle) job chain. The JobScheduler skips the jobs in between and ignores the return value of the job and the next_state
and error_state
configuration of the job chain node.<?xml version="1.0" encoding="ISO-8859-1"?>
<job order="yes" stop_on_error="no">
<script language="javax.script:ecmascript">
<![CDATA[
function spooler_process(){
var today = new Date();
var day_of_month = today.getDate();
if (day_of_month == 12){
spooler_log.info("Today is the 12th - skipping job chain b");
spooler_task.order().set_state("end_of_chain_b");
}
return true;
}
]]>
</script>
<run_time />
</job>