/* Create test folder */
/* stmt 14 */
create or alter folder SYSTEM.TEST;
/* Create child that will fail when executed */
/* stmt 15 */
create or alter job definition SYSTEM.TEST.FAIL_JOB
with
profile = 'EXIT-PROFILE',
environment='SCHEDULIX_LOCALHOST_1@SCHEDULIX-EU-WEST-1A-1',
type = job,
errlog = 'logs/${JOBID}.log' NOTRUNC,
logfile = 'logs/${JOBID}.log' NOTRUNC,
master,
run program = './runjob.sh DELAY -duration 2 -units ms -exitcode "$EXITCODE"',
group = public,
parameters = ( 'EXITCODE' );
/* Create sendmail job that will be triggered */
/* stmt 16 */
create or alter job definition SYSTEM.TEST.SENDMAIL
with
profile = 'NOVA-EXIT-PROFILE',
environment='SCHEDULIX_LOCALHOST_1@SCHEDULIX-EU-WEST-1A-1',
type = job,
errlog = 'logs/${JOBID}.log' NOTRUNC,
logfile = 'logs/${JOBID}.log' NOTRUNC,
master,
run program = './sendmail.sh "$TRIGGERBASE" "$TRIGGERNEWSTATE"',
group = public;
/* Create top level job */
/* stmt 17 */
create or alter job definition SYSTEM.TEST.TEST_SEND_MAIL
with
profile = 'EXIT-PROFILE',
environment='SCHEDULIX_LOCALHOST_1@SCHEDULIX-EU-WEST-1A-1',
type = job,
errlog = 'logs/${JOBID}.log' NOTRUNC,
logfile = 'logs/${JOBID}.log' NOTRUNC,
master,
run program = '0',
parameters = ( 'EXITCODE' ),
group = public;
/* Define parameter to be correct */
/* stmt 18 */
alter job definition SYSTEM.TEST.TEST_SEND_MAIL
alter
parameter = (
'EXITCODE' PARAMETER default = 'NO_RESPONSE'
);
/* Add the child */
/* stmt 19 */
alter job definition SYSTEM.TEST.TEST_SEND_MAIL
add or alter children = (
SYSTEM.TEST.FAIL_JOB
static
enable
CHILDSUSPEND
translation='EXIT-TRANSLATION'
ignore dependency = none
);
/* Add the trigger */
/* stmt 20 */
create or alter trigger 'ON_FAILURE' on job definition SYSTEM.TEST.TEST_SEND_MAIL
with
active,
condition = none,
nomaster,
nowarn,
limit state = none,
nosuspend,
state = (
'FAILURE'
),
submitcount = 1,
submit SYSTEM.TEST.SENDMAIL,
type=FINISH CHILD;
end multicommand;