Page 1 of 1

Potential Issue with DSJS.RUNWARN in Sequence Job

Posted: Thu Aug 25, 2016 11:02 am
by jweir
Hi all,

I have a sequence job that contains say 5 parallel jobs. In the fourth parallel job trigger, I have to output links. One link is for a "successful" run, and the other link is for a "failed" run.

For the successful trigger, I have this conditional statement: "DSJS.RUNWARN or DSJS.RUNOK".

However, it happened that when this fourth job ran and failed, the fifth job actually started. This is not something I want. When the fourth job fails, I do not want the fifth job to start.

Now in the Director log, I do see that this fourth job threw warnings. Now my question is: Even if the job fails and has warnings in the job log, does the 'DSJS.RUNWARN' make the sequence job move on to the next job?

Thanks in advance.

Posted: Thu Aug 25, 2016 11:45 am
by chulett
RUNWARN means "finished with warnings" so it would have to "succeed" but have warnings rather than actually ABORT for the trigger to pass control thru.

One suggestion - if you have two triggers and one should go forward and everything else should stop, I always used "Otherwise" on the latter so I didn't have to list out all of the things not covered by the former.

Posted: Thu Aug 25, 2016 12:35 pm
by jweir
Thanks for the quick reply chulett.

I am not a premium member, so I cannot see your entire answer. However, I am thinking you are confirming my beliefs that DSJS.RUNWARN can allow the sequence to continue even if the job is aborted when the job has warnings.

I would think the safest route with have the custom trigger read something like:

Code: Select all

JOB_ACTIVITY_NAME.$JobStatus < 3

Posted: Thu Aug 25, 2016 1:01 pm
by chulett
I opened it up, hopefully it helps.

Posted: Fri Aug 26, 2016 12:21 am
by rbk
hi jweir,
I think Craig meant that the DSJS.RUNWARN definitely needs the job to succeed and have warnings to pass through.

If the job had aborted with warnings, there is no way for the trigger to get activated.

Can you please re-validate your trigger conditions ?

Posted: Fri Aug 26, 2016 7:40 am
by jweir
Thanks.

If you are saying the RUNWARN has to succeed in order for it to move forward, then something else must be at play. My current trigger for the 'success' link was:

Code: Select all

DSJS.RUNWARN or DSJS.RUNOK
And for my 'failed' link was just the Expression Type 'Failed' option.

So then my question still remains then. How can this setup produce the results I was seeing?

I made a test and put the 'success' link with this code:

Code: Select all

JOB_ACTIVITY.$JobStatus = 1 or JOB_ACTIVITY.$JobStatus = 2
and that code worked as expected. After the job failed, the next job did not start.

Any more thoughts?

Thanks in advance.

Posted: Fri Aug 26, 2016 7:53 am
by chulett
Ack... forgot to point out the fly in the ointment! :shock:

Those values are just the "1" and the "2" you used explicitly in your second example, they do not stand on their own. So your first attempt equates to saying "1 or 2" which is always true.

Combine the two to get everything all proper like:

Code: Select all

JOB_ACTIVITY.$JobStatus = DSJS.RUNWARN or JOB_ACTIVITY.$JobStatus = DSJS.RUNOK

Posted: Fri Aug 26, 2016 8:58 am
by jweir
Ah ok. So you are saying by putting the below just in the trigger, no matter what, it is always true?

Code: Select all

DSJS.RUNWARN or DSJS.RUNOK
I will test out your suggestion.

Thanks.

Posted: Fri Aug 26, 2016 8:59 am
by chulett
Yup! It needs to know what ran ok or with warnings.

Posted: Fri Aug 26, 2016 11:58 am
by jweir
Thanks chulett. Your suggestion worked.