Job Sequence Trigger is not getting Triggered

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Vijay Kumar
Participant
Posts: 59
Joined: Sat May 29, 2004 12:31 am
Location: Pune

Job Sequence Trigger is not getting Triggered

Post 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
Kirtikumar
Participant
Posts: 437
Joined: Fri Oct 15, 2004 6:13 am
Location: Pune, India

Post 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.
Regards,
S. Kirtikumar.
Vijay Kumar
Participant
Posts: 59
Joined: Sat May 29, 2004 12:31 am
Location: Pune

Post 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: Job Sequence Trigger is not getting Triggered

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Vijay Kumar
Participant
Posts: 59
Joined: Sat May 29, 2004 12:31 am
Location: Pune

Post 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
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post 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
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post 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.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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:
-craig

"You can never have too many knives" -- Logan Nine Fingers
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Gotchya. :)
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Vijay Kumar
Participant
Posts: 59
Joined: Sat May 29, 2004 12:31 am
Location: Pune

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Can you wrap these designs in Code tags, so that you can get the formatting right (and therefore comprehensible) please?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Vijay Kumar
Participant
Posts: 59
Joined: Sat May 29, 2004 12:31 am
Location: Pune

Post 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
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post 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.
Last edited by kris007 on Thu Oct 12, 2006 11:38 pm, edited 1 time in total.
Kris

Where's the "Any" key?-Homer Simpson
Post Reply