COGNOiSe.com - The IBM Cognos Community

ETL, App Development and other tools => COGNOS DecisionStream/Data Manager => Topic started by: jkabir on 29 Aug 2019 02:35:34 pm

Title: Add notification on Data Manager ETL
Post by: jkabir on 29 Aug 2019 02:35:34 pm
Hi all,
I need help on adding a notification when my ETL job fail or success.

How and what logic should I use on email node or conditional node?

Thank you for your help.
Title: Re: Add notification on Data Manager ETL
Post by: MFGF on 29 Aug 2019 02:54:08 pm
Hi all,
I need help on adding a notification when my ETL job fail or success.

How and what logic should I use on email node or conditional node?

Thank you for your help.

Hi,

Within a JobStream, every node sets (by default) a boolean variable called $RESULT. If you set the action on failure of each node to "Continue", you can then use a condition node after the node you want to test - the expression you would use in the condition node would be
return $RESULT
The True output from the condition node would then progress to running the next node (success) or to an email node which you could use to send an email indicating success (if you wish to). The False output would link to an email node, which you could use to send an email indicating your failure.

Cheers!

MF.
Title: Re: Add notification on Data Manager ETL
Post by: jkabir on 29 Aug 2019 03:13:01 pm
Thank you for your answer.
Did you mean I would have to use both email and conditional node?
I am new to Data Manager. Could you  please help me with screenshot if possible?
Title: Re: Add notification on Data Manager ETL
Post by: MFGF on 29 Aug 2019 03:22:25 pm
Thank you for your answer.
Did you mean I would have to use both email and conditional node?
I am new to Data Manager. Could you  please help me with screenshot if possible?

Hi,

Yes - the Condition Node is used to test the RESULT variable and send the processing down either a TRUE or FALSE path in your jobstream. Email nodes are used to send emails, so you can have different emails by using two different email nodes in your TRUE path and your FALSE path.

Sadly I don't have Data Manager available to me at the moment, so I'm not able to send any screen shots. Just go to your Jobstream and bring in the required nodes, then link them using the linking tool (there is a button for this on the toolbar at the top).

Cheers!

MF.
Title: Re: Add notification on Data Manager ETL
Post by: jkabir on 29 Aug 2019 03:45:04 pm
Thanks a lot.
i am going to write only this return $RESULT;
to the action field in the condition node. Please see the attached pic for more info.
Title: Re: Add notification on Data Manager ETL
Post by: MFGF on 30 Aug 2019 06:57:46 am
Thanks a lot.
i am going to write only this return $RESULT;
to the action field in the condition node. Please see the attached pic for more info.

Hi,

It looks like you have two fact builds running in sequence in your jobstream? Did you want to check the success or failure of both, or just the second one? If you want to check them both, you will need them to set different variables, otherwise the second build will overwrite the contents of $RESULT from the first build. You can change the name of the variable in the properties of the fact build nodes in your jobstream - eg have the first build set $RESULT and the second build set $RESULT2. You can then check both variables in your condition node.
Alternatively, you could add an extra condition node after the first build to check if it failed.
A very important step not to forget is to set the "Action on failure" to be "Continue" in the properties of both fact build nodes - otherwise a failure will stop the jobstream from progressing to your condition node(s).
One observation... It looks like your jobstream could loop infinitely, running the same two builds over and over and over. Is that your intent?

Cheers!

MF.
Title: Re: Add notification on Data Manager ETL
Post by: jkabir on 30 Aug 2019 07:40:31 am
Dear MF.
You are a life saver no doubt!
here is what I did! what logic would I have to put in the condition? please see the attached screenshot.
Thanks a lot for your time!
Title: Re: Add notification on Data Manager ETL
Post by: jkabir on 30 Aug 2019 07:41:56 am
Dear MF.
You are a life saver no doubt!
here is what I did! what logic would I have to put in the condition? please see the attached screenshot.
Thanks a lot for your time!
Title: Re: Add notification on Data Manager ETL
Post by: jkabir on 30 Aug 2019 07:56:06 am
Dear MF.
What can I do if i do not want to loop infinitely?
Thanks a lot for your time!
Title: Re: Add notification on Data Manager ETL
Post by: MFGF on 30 Aug 2019 08:11:24 am
Dear MF.
You are a life saver no doubt!
here is what I did! what logic would I have to put in the condition? please see the attached screenshot.
Thanks a lot for your time!

Hi,

If you want the condition node to check the immediately preceding build for failure, your expression would be

return $RESULT

Cheers!

MF.
Title: Re: Add notification on Data Manager ETL
Post by: MFGF on 30 Aug 2019 08:12:41 am
Dear MF.
You are a life saver no doubt!
here is what I did! what logic would I have to put in the condition? please see the attached screenshot.
Thanks a lot for your time!

as above, just use the expression
return $RESULT

MF.
Title: Re: Add notification on Data Manager ETL
Post by: MFGF on 30 Aug 2019 08:19:01 am
Dear MF.
What can I do if i do not want to loop infinitely?
Thanks a lot for your time!

What is your desired outcome? To run each build once then finish? If so, the issue you have is that the TRUE output from your Condition Node links back to the first build. You need to break this link. If you want to do something else after the second build completes, add the relevant node or nodes for this and link the TRUE output to this. For example, you might want to send an email confirming success (email node) or write a message to the log file indicating success eg procedure node with an expression such as logmsg('Build successful')

If you want to check the status of the first build too, add another condition node, and link the first build to this instead of linking directly to your second build. Link the TRUE output of this condition node to the second build, and the FALSE output to an email node indicating the first build failed.

Cheers!

MF.
Title: Re: Add notification on Data Manager ETL
Post by: MFGF on 30 Aug 2019 08:47:15 am
Here is a mocked-up graphic (done in PowerPoint) of how I would do this if I were you.

(https://i.ibb.co/SRjXjkp/Job-Stream-Graphic.png)

Cheers!

MF.
Title: Re: Add notification on Data Manager ETL
Post by: jkabir on 30 Aug 2019 08:54:51 am
Hi MF,
Yes I want the successful email message. I have implemented according to your advise.
Now the question is what expression should I use in condition node in the action field? Should I write any expression?
Thanks again.
Title: Re: Add notification on Data Manager ETL
Post by: MFGF on 30 Aug 2019 09:10:24 am
Hi MF,
Yes I want the successful email message. I have implemented according to your advise.
Now the question is what expression should I use in condition node in the action field? Should I write any expression?
Thanks again.

Hi,

Ummmmm. Didn't we already cover this?

return $RESULT

That should be all you need :)

MF.