If you are unable to create a new account, please email support@bspsoftware.com

 

Add notification on Data Manager ETL

Started by jkabir, 29 Aug 2019 02:35:34 PM

Previous topic - Next topic

jkabir

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.

MFGF

Quote from: 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.

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.
Meep!

jkabir

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?

MFGF

Quote from: 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?

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.
Meep!

jkabir

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.

MFGF

Quote from: 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.

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.
Meep!

jkabir

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!

jkabir

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!

jkabir

Dear MF.
What can I do if i do not want to loop infinitely?
Thanks a lot for your time!

MFGF

Quote from: 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!

Hi,

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

return $RESULT

Cheers!

MF.
Meep!

MFGF

Quote from: 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!

as above, just use the expression
return $RESULT

MF.
Meep!

MFGF

Quote from: 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!

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.
Meep!

MFGF

Here is a mocked-up graphic (done in PowerPoint) of how I would do this if I were you.



Cheers!

MF.
Meep!

jkabir

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.

MFGF

Quote from: 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.

Hi,

Ummmmm. Didn't we already cover this?

return $RESULT

That should be all you need :)

MF.
Meep!