Page 1 of 2

Job Sequence Trigger is not getting Triggered

Posted: Thu Oct 12, 2006 5:48 am
by Vijay Kumar
Hi,
One of the trigger in a job sequence is not getting triggered in the following scenario:

Job1 : ---->$JobStaus>=0 and $JobStatus <=2 ---> Job2
:----->(Unconditional)----> LogExtractRoutine(custom routine)
:------>(On Failure)-------> Terminator

In the above scenario if the job1 fails the LogExtractRoutine is not getting triggered. I had changed the Uncoditional with $JOBSTATUS >=0,but no use.

On job1 success or failure I want to trigger the routine and onsuess of job1 I want to trigger job2.

Could any one help me to resolve the above issue or let me know If I need to use any other conditions?

Thanks in advance
Vijay

Posted: Thu Oct 12, 2006 5:51 am
by Kirtikumar
In job properties for the sequence, check if the property Automatically handle the aborted activities is enabled or disabled.

If it is selected, deselect it and try again.

Posted: Thu Oct 12, 2006 6:25 am
by Vijay Kumar
Hi,
I have unchecked the checkbox and tried, but no use.
I tried to remove the Terminator link and my sequencer is as follows:
job1---->($JOBSTATUS >=0 and $JobSTATUS <=2)---Job2
-----> Unconditionla---->rouine

When the job1 is aborted the routine is running fine but the sequencer is running success without abort message.
Then I tried to Check the Automatically handle the job Fail check box and ran the job.
This time again on job1 failure the routine is not getting executed but the sequencer is getting aborted (becz of job1 failure)

Is there any other way to try this??

Regards,
Vijay

Re: Job Sequence Trigger is not getting Triggered

Posted: Thu Oct 12, 2006 7:46 am
by chulett
Vijay Kumar wrote:On job1 success or failure I want to trigger the routine and onsuess of job1 I want to trigger job2.
Why make it more complicated than it needs to be? Dump the custom trigger. Two simple triggers will work:

For the link from Job1 to the Routine - 'Unconditional'.

For the link from Job1 to Job2 - 'OK - (Conditional)'

Does 'success of Job1' also include ran with warnings? If that's the case, then switch back to a Custom trigger:

Code: Select all

Stagename.$JobStatus = DSJS.RUNOK Or Stagename.$JobStatus = DSJS.RUNWARN
Note the proper use of the $JobStatus activity variable - you must include the name of the Job Activity stage that executed the job and properly case everything. Replace 'Stagename' with the correct one for your Sequence job.

Posted: Thu Oct 12, 2006 8:21 am
by Vijay Kumar
Hi,
Here the issue is that the Unconditional trigger is getting triggered only when the Job runs successfully and it is not getting triggered when the Job fails.

Please refer to my initial post.

Regards,
Vijay

Posted: Thu Oct 12, 2006 8:30 am
by DSguru2B
I think its by passing it. The failure is being handled in the second trigger. If you want unconditional, then explicitly provide them there.

Code: Select all

Stagename.$JobStatus = DSJS.RUNOK Or Stagename.$JobStatus = DSJS.RUNWARN Or Stagename.$JobStatus = DSJS.RUNFAIL

Posted: Thu Oct 12, 2006 8:47 am
by chulett
I referred to all of your posts before replying, always do. My Guru friend, please don't try to code in something 'Unconditional'... that isn't. It only covers three of the many possible outcomes a job could have.
Vijay Kumar wrote:Here the issue is that the Unconditional trigger is getting triggered only when the Job runs successfully and it is not getting triggered when the Job fails.
Not possible, unless you've involved the 'Automatically handle' option, an Exception Handler or the Terminator, in which case the first abort could shut down the entire choo-choo train. Without anything like that, however, you have control of the flow and an abort can be handled as I noted.

Posted: Thu Oct 12, 2006 8:58 am
by DSguru2B
True. But if the OP wants the job to run regardless the earlier job is successful or failed. Then these three options should handle it. Right? Please correct me if i am wrong.

Posted: Thu Oct 12, 2006 9:15 am
by chulett
Most of the time, yes - but there are more ways then one for a job to fail. Never mind the fact that there is no advantage to that approach over the Unconditional trigger, only negatives. :wink:

Posted: Thu Oct 12, 2006 9:27 am
by DSguru2B
Gotchya. :)

Posted: Thu Oct 12, 2006 9:28 am
by Vijay Kumar
Hi,
To be more specific my job looks like this

Job1 : ---->$JobStaus>=0 and $JobStatus <=2 ---> Job2
:----->(Unconditional)----> LogExtractRoutine(custom routine)
:------>(On Failure)-------> Terminator

Job2 : ---->$JobStaus>=0 and $JobStatus <=2 ---> Job3
:----->(Unconditional)----> LogExtractRoutine(custom routine)
:------>(On Failure)-------> Terminator

Job3 ----> Unconditional---> Log ExtractRoutine
----> on Failure -------> Terminator

In each case I want to handle all the above mentioned three conditions.
the Unconditional trigger generates the log file on the Unix OS by executing the routine(which extracts the logs)

Now the Unconditional trigger is getting triggered only when the JobActivity is getting sucess in case of failure it is not getting triggered. I even tried the option of $JOBStatus >=0(but no use)

Do I need to modify the Unconditional condition with any other options?

and Automatically handle jobs that fail option is unchecked

Posted: Thu Oct 12, 2006 2:24 pm
by ray.wurlod
Can you wrap these designs in Code tags, so that you can get the formatting right (and therefore comprehensible) please?

Posted: Thu Oct 12, 2006 3:01 pm
by chulett
And include the real Trigger values, not something you've typed in by hand that is close. "$JobStaus>=0 and $JobStatus <=2" is invalid syntax for a Custom trigger and would not even compile.

Posted: Thu Oct 12, 2006 11:04 pm
by Vijay Kumar
Hi,
Here is the exact code:

Code: Select all

Stage Name is JobActivity

Name            ExpressionType          Expression
lnk_Success   Custom-(Conditional)  JobActivity.$JobStatus>=0
                                                      and
                                                     JobActivity.$JobStatus<=2
lnk_Log         Unconditional              N/A
lnk_Failure     Failed-(Conditional)    "ExecutionFailed"        
I am not typing anything under Trigger tab, everything I am selecting from the Activity section by right clicking.

Hope this gives the complete picture of the code. The same code is applicable for each job activity.

The issue is with only the Unconditional trigger. It is not getting triggered when the JobActivity fails.

Can I know what is the exact meaning of Unconditonal trigger, as per my understanding it has to trigger what ever be the result of the JobActivity.

Kindly help me in resolving me this issue.

Regards,
Vijay

Posted: Thu Oct 12, 2006 11:31 pm
by kris007
Here's what you would need to do

Code: Select all




             |--->>Ok or CustomTrigger>>Sequencer(Any)-------
Job1----- |                                                ^                          |
             |                                                |                           V
             |--->>Unconditional--->>Sequencer(Any)        Sequencer(Any)
             |                                         |                             ^        |
             |                                         V                            |          |
             |---->>Failure>>Sequencer(Any)--------------------          V
                                                                                      RoutineActivity

That is what I believe you would want to achieve. If that is correct, then to make things simple, you can just use two triggers--custom and failure coming out from your job activity and going into the sequencer(set to any) which then runs your Routine Activity.