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

chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Vijay Kumar wrote:I am not typing anything under Trigger tab, everything I am selecting from the Activity section by right clicking.
Good, thanks. I only mentioned it because you have been doing it in all your previous posts when you posted your trigger code.

Now... do you have any of the four 'Compilation Options' enabled on the General tab of the Job Properties page? Are you using an Exception Handler or Terminator Activity stage in your job?

As to the 'exact meaning' of the Unconditional trigger, it is defined in the Help for the stage, they all are:
Unconditional. An unconditional trigger fires the target activity once the source activity completes, regardless of what other triggers are fired from the same activity.
In other words, all the time - unless you've enable an option or used a stage that 'takes over' the job flow when a job fails. If that is the case, any activities after the failure would not take place regardless of the trigger. Hence the other questions.

ps. A $JobStatus of 0 means the job is running...
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

kris007 wrote:Here's what you would need to do
No, not really. Unconditional is just that, unconditional - none of the other links are needed. We're missing something here, something Vijay hasn't told us yet...
-craig

"You can never have too many knives" -- Logan Nine Fingers
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

kris007 wrote: That is what I believe you would want to achieve. If that is correct,...
From what I understand Craig, OP wants the Routine activity to run no matter what i.e. when job fails or finishes and extract the log information and then abort the job if the jobactivity has failed. It's that unless, ofcourse, as you have already mentioned, We're missing something here, something which he needs to tell us.
Kris

Where's the "Any" key?-Homer Simpson
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

kris007 wrote:From what I understand Craig, OP wants the Routine activity to run no matter what i.e. when job fails or finishes and extract the log information
Which is exactly the kind of situation an Unconditional trigger is used for.

Vijay, are you positive the Routine Activity stage is not being triggered? If you put something in the 'Logging text' box on the General tab of the stage, does it show up when you run the Sequence?
-craig

"You can never have too many knives" -- Logan Nine Fingers
kris007
Charter Member
Charter Member
Posts: 1102
Joined: Tue Jan 24, 2006 5:38 pm
Location: Riverside, RI

Post by kris007 »

Yep. It should be that simple. Was just stretching my brain a bit too far :wink: But I guess he will still need to split those triggers(ok and failure) and put some sequencers in place to abort the sequence if the jobactivity fails.Now, I guess we will have to wait for Vijay to come back...
Kris

Where's the "Any" key?-Homer Simpson
Vijay Kumar
Participant
Posts: 59
Joined: Sat May 29, 2004 12:31 am
Location: Pune

Post by Vijay Kumar »

Hi All,
I found the answer for the issue...
It sounds to be simply but its important to note the order of the triggers.

The order of the triggers for my issue should be as follows.

OnSuccess
OnFailure and then
UnConditional.

If UnConditional is in between then the Unconditional trigger will not execute if the Job Activity is failed.

Thanks for everyone for giving their valuable inputs.

Regards,
Vijay
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I'm probably going to regret this, but can't let this end on that note. :?

No, I'm afraid your assertation isn't true. Something else is still at work here. If you want to spend the time trying to figure it out, let us know, but for the sake of everyone else playing along in the home audience I need to make a point.

Triggers in Sequence jobs are not order dependant, not even the Otherwise trigger. I've already posted the Help text for the Unconditional trigger, and the Otherwise makes it clear there is no positional dependancy there either (emphasis mine):
Unconditional. An unconditional trigger fires the target activity once the source activity completes, regardless of what other triggers are fired from the same activity.

Otherwise. An otherwise trigger is used as a default where a source activity has multiple output triggers, but none of the conditional ones have fired.
I've got an example job Sequence I cobbled together to illustrate this which I'd be more than happy to send you. It has one Job Activity stage with three triggers to three other Job Activity stages. The first job is coded to run ok, with warnings or abort based on a parameter. The links are identical to yours. The end result? Regardless of the status the first job ends with, the unconditional trigger always fires. Regardless of the order of the triggers, the unconditional trigger always fires. That's why it is called 'unconditional'.

For grins I added another trigger to the mix, set it to 'Otherwise', made it the first trigger and it still behaved as noted above. They are not like Reject links but check for the outcome of all other conditional links (note that the unconditional link firing has no bearing on things) before deciding what to do. Not that that has any bearing on your issue, just wanted to make that point as well.

Even setting various combinations of the Compilation Options in the Sequence job - add checkpoints, automatically handle, log - did not affect the outcome of the triggers firing.

The only time I could come close to what you are saying is happening is when I had 'automatically handle' enabled in the job and had removed the failure trigger. In that particular situation where the Sequence didn't think I was handling the aborts and I'd told it to handle them for me, the Sequence job code took over when the first job failed and the unconditional trigger did not fire. It is important to note, however, that in that situation none of the triggers fired. None, as the Sequence on failure branched to its own error handling code. You can tell when you are in that situation because it will log a message to that effect in the Sequence job's log:
(<Job1StageName>) Controller problem: Unhandled abort encountered in job <Job1Name>
At that point everything either stops or branches to an Exception Handler. Are you seeing anything like this in your logs? If not, then something else is going on in your world. Perhaps a bug in your particular version? Who knows. You never answered my questions about those settings or the other stages you may or may not have in the job or if you tried any logging text bread crumbs. All I can say is I've never seen any evidence that triggers are positional / affected by their order, and the documentation makes no mention of it. If someone can put together an example that refutes that, I'd be more than happy to print a retraction and grovel appropriately. :wink:

ps. Try different combinations of situations and then check the generated code under the Job Control tab of the Job Properties for the Sequence, it's fun stuff but the code is there documenting the behaviour for you to see.
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Ok... played around more with this after noting your 'to be more specific' post where you introduced the Terminator Activity stage. It looks to be causing your issue, or again at least something close to your issue. :wink:

Add in a trigger to a Terminator Activity stage and then trigger order does play a role in the game. It looks like it is trying to be 'smart' and decide what to do based on where in the mix you branch to it.

Put the link to the Terminator Activity stage first and the Sequence aborts things right then and there. Note that none of the other tiggers fire, it just aborts the sequence. It also logs a 'Sequence abort requested' fatal message.

Put the Unconditional link first and it fires. Immediately after that, the Terminator Activity stage kicks in and sends a STOP request to the unconditional job or any other jobs that had fired before it. In my case, the STOP request had no effect as the jobs only take moments to run. Again, the log will note the fact that it is 'Sending STOP request to job' and include the job name it is attempting to stop.

So, with the Terminator Activity linked directly to a Job Activity, you need to take care where in the order of things the Terminator Activity sits. It looks to me like, once it fires, none of the triggers after it will fire. This makes sense and is specific behaviour associated with using the Terminator Activity stage in this manner rather than linked to an Exception Handler, which is how I use it. Why trigger more activities when you've just requested they all be shut down? It doesn't change the basic rules of when the various trigger types fire or under what circumstances - behaviours get overridden with this particular stage in the mix.

You should be able to confirm this by a careful examination of the log messages of the main Sequence job. You'll see it either shut things down or let them start and then STOP them depending on the link ordering. It's not about the Uncondition trigger being between the other two, per se, but should be all about the position the trigger linked to the Terminator Activity stage fires from. Hopefully that explains the behaviour that you are seeing.... let us know.
-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 Chulett,
Thank you very much for you reply, I will try to work on all the options that you have specified and I will figure out the error.

Once again thank you very much for you explanation on triggers in Sequencer job.

Regards,
Vijay
Post Reply