Putting error email notification

Highlighted
Four Stars

Putting error email notification

hi there,

 

I'm new to Talend Open Studio version 7.  We have an old ETL jobs that was running in the older version.  I have a project to enhaceme these ETL jobs on this newer version.  Currently, our jobs was to load from multiple schema and to multiple tables.  One on my plans is to put some error notification.  So below, I have a job that loops multiple schemas by checking which clients are active.  It passes and loops the schema values on my 3 child jobs and these child jobs loads 25-30 from schema to datamart.  Can you please help me how can I put my email notification.  It seems that on my tJava, it wasn't able to read the error?

 

on my tJava:

globalMap.put("errorCode", tLogCatcher_1.message);

 

 

Highlighted
Nine Stars

Re: Putting error email notification

@mj_00 Please follow below steps. i have a simple job loading from list of files to a database, for this i used code from outline and wrote in the message box of Email component

 

Code in the message for my simple job i used is here

 

"Job name : " + jobName
+ "\n" +
"File processed : " + StringHandling.LEFT(((String)globalMap.get("tFileList_2_CURRENT_FILE")),StringHandling.INDEX(((String)globalMap.get("tFileList_2_CURRENT_FILE")),".")) + ".zip"
+ "\n" +
"Number of records in file : " + ((Integer)globalMap.get("tFileInputDelimited_1_NB_LINE"))
+ "\n" +
"Number of records successfully loaded : " + ((Integer)globalMap.get("tMSSqlOutput_1_NB_LINE_INSERTED"))
+ "\n" +
"Number of records failed initial validation : " + (Integer)globalMap.get("counterValidationError")
+ "\n" +
"Number of records failed due to other technical reasons : " + ((Integer)globalMap.get("tFileInputDelimited_1_NB_LINE") - (Integer)globalMap.get("counterValidationError") - (Integer)globalMap.get("tMSSqlOutput_1_NB_LINE_INSERTED"))
+ "\n" +
" Error file generated at : " + context.ZebuErrorDirectory +StringHandling.LEFT(((String)globalMap.get("tFileList_2_CURRENT_FILE")),StringHandling.INDEX(((String)globalMap.get("tFileList_2_CURRENT_FILE")),".")) + "-" + TalendDate.formatDate("yyyyMMddHHmmssSSS",(Date)globalMap.get("loadDate")) + ".txt"

 

You can find this code for components in the outline at left side bottom in studio

 

Let me know if you have any further questions, by doing this we can get an email error notification with clear message, use all the components where the transactions were performed

 

snowflake.PNGemailerror.PNG

 

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog