Bypassing notification activity in a sequencer

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

splayer
Charter Member
Charter Member
Posts: 502
Joined: Mon Apr 12, 2004 5:01 pm

Bypassing notification activity in a sequencer

Post by splayer »

I would like to bypass notification activity in a sequencer based on certain condition. For other conditions, I would like to execute the Notification Activity. What would be the best way to go about it?
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

Use a Nested Condition in your Job sequence.
Based on your condition, pass the output links to a Notification Activity or somethiing else
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
splayer
Charter Member
Charter Member
Posts: 502
Joined: Mon Apr 12, 2004 5:01 pm

Post by splayer »

I would like to develop a custom or build stage to do this. Would it be a good idea? Which one would be better?
thebird
Participant
Posts: 254
Joined: Thu Jan 06, 2005 12:11 am
Location: India
Contact:

Post by thebird »

Why not just put the condition in the Trigger and link it appropriately to Notification Activity and the other DS activity that need to be triggered?

Again it would depend on the condition that you would want to specify - what theoptimal solution is. What is the condition that you need to trigger these based on?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You don't need a custom stage, or a Nested Condition typically. As noted, you should be able to do this via Triggers the vast majority of the time. Send the results off to Notification that you want and the rest simply bypass it.

If that's unclear, why not provide some specific examples so we can understand your issue?
-craig

"You can never have too many knives" -- Logan Nine Fingers
splayer
Charter Member
Charter Member
Posts: 502
Joined: Mon Apr 12, 2004 5:01 pm

Post by splayer »

I have a WaitForFile activity stage. If the file does not appear by a certain time (let's say noon), I have to notify by email using the Notification activity.
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

Craig, always has a better method :wink:

Have two O/P links from the Wait_For_File_Activity
One to the Notification Activity, the Expression can be like -

Code: Select all

Wait_For_File_Activity_0.$ReturnValue = 0
Another having expression

Code: Select all

Wait_For_File_Activity_0.$ReturnValue = 1
Check the Return Values before implementing it.
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
I_Server_Whale
Premium Member
Premium Member
Posts: 1255
Joined: Wed Feb 02, 2005 11:54 am
Location: United States of America

Post by I_Server_Whale »

How about this?

Code: Select all



Wait_For_File   -------------------------------> Notification_Activity
       |
       |
       |
       |
       |
       |
       V
Terminal_Activity

You should probably be using 'ReturnValue' triggers.

Whale.
Last edited by I_Server_Whale on Thu Dec 14, 2006 5:02 pm, edited 1 time in total.
Anything that won't sell, I don't want to invent. Its sale is proof of utility, and utility is success.
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You don't need to check anything specific for this. Two simple triggers - OK (Conditional) and Otherwise will do it for you. OK will fire when the file is found and the Otherwise trigger will catch anything else, including when it doesn't show up.
-craig

"You can never have too many knives" -- Logan Nine Fingers
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

chulett wrote:You don't need to check anything specific for this. Two simple triggers - OK (Conditional) and Otherwise will do it for you. OK will fire when the file is found and the Otherwise trigger will catch anything else, including when it doesn't show up.
Now its bestest!
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
splayer
Charter Member
Charter Member
Posts: 502
Joined: Mon Apr 12, 2004 5:01 pm

Post by splayer »

Craig, where can I find the values of WaitForFileActivity? That is, under what conditions would it be Ok? Is that when the file is present?

As far as my problem, it is little bit more complicated than that. At 12 noon, I need to check whether the file is there or not using WaitForFileActivity which is looping and checking every minute. If it is not there then I send the notification email using NotificationActivity stage and then continue with the loop.

Anyway, I did another sequence job where I do an ExecCommand to check for the file's existence and then do the notification. I plan to schedule this at noon.

Anyway, a better solution from anyone would be appreciated.
I_Server_Whale
Premium Member
Premium Member
Posts: 1255
Joined: Wed Feb 02, 2005 11:54 am
Location: United States of America

Post by I_Server_Whale »

Exactly what I suspected !

You do not want to wait for a certain period of time to find whether the file has appeared or not.

But instead you want to check its existence exactly at 12 noon.

Am I right?

Whale.
Anything that won't sell, I don't want to invent. Its sale is proof of utility, and utility is success.
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

splayer wrote:Craig, where can I find the values of WaitForFileActivity? That is, under what conditions would it be Ok? Is that when the file is present?
It can be Ok based on the condition selected by you is met i.e
"Wait for file to appear" or "Wait for file to disappear" , otherwise it is not OK
In other words
If you get a return value from Wait_For_File_Activity_0.$ReturnValue as 0 then it is OK
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I've never seen it officially documented anywhere, this is just from my experience using it. And Narisimha is correct in that whatever your condition is you select - for a file to appear or disappear - when the condition is met you get an OK status from the stage. When the timeout limit is reached, you get a 'not OK' status.

And I wouldn't use the $ReturnValue even though it may very well work. That's just me being anal, but technically you would only get a 'Return Value' from a Routine Activity or Execute Command stage. Otherwise, it's a status that can be checked with 'normal' triggers.
-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 »

chulett wrote:
That's just me being anal, ...
O c'mon Craig. Your just being technically correct :wink:
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Post Reply