Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I created this job in which there are two tables Employee and Employee_INC. Employee table is my source table if any new record is inserted then only that particular record should be inserted for that I am separating old records and new inserted records using tmap. Then in flow meter I am reading the information and then catching the information using flow meter catcher then I am storing into log table tbdboutput2 after that I am sending mail for the action.
But I am getting two different mails one for new inserted records and other for old records separately.
How can I combine both and get both the data in single mail.
Thanks
Amit
Hi
There are two tFlowMeter components in the job, each tFlowMeter will trigger tFlowMeterCatcher execution, that's why you receive two emails.
You can store the data into memory using tHashOutput, in the end of job, read the data from memory and send only one email.
eg..
tFlowMeterCatcher...tlogrow--tDBOutput--main--tHashOutput
tPostJob--oncomponentok--tHashInput--main--tSendMail
Regards
Shong
Hi Shong,
As per your instructions I did the same still I am getting two different mails.
Please have a look on it.
Thanks
Amit
You'd have to aggregate your results (tAggregate* ) into 1 single row and send that to the mail.
You're triggering tSendMail twice
Hi,
So, I added that aggregate row component now, but I am getting null values in my mail.
This is what I want to print in my mail.
------------------------------------------------------------------------------------
------------------------------------------------------------------------------------
Please have a look.
Thanks
Amit
What could be the value for Action? No of records=inserted records+old records?
In the first image it is clearly visible that 5 old records and 0 new Inserted records.
Action : Old Records
No of Records = 5
Action : Inserted
No of Records = 0
The requirement is clear now. To implement it, define a context variable let's call it message, string type. In the beginning job, initialize the value of the variable with execution time and job name on a tJava:
context.message="This is notification for the insertIncrmentalJob"+"\r\n"+"Time at Job execution: "+TalendDate.formatDate("yyyy-MM-dd HH:mm:ss", TalendDate.getCurrentDate())+"\r\n"+"JobName: "+jobName;
Append the action and no of records value to the context variable on a tJavaRow after tFlowMeterCatcher.
tFlowMeterCatcher--tDBOutput--main--tJavaRow
on tJavaRow:
context.message=context.message+"\r\n"+"Action: "+input_row.label+"\r\n"+"No of records: "+input_row.count;
In the end of job, send an email using tSendMail, set the Message field with context variable context.message.
tPostJob--oncomponent--tSendMail
Hope it helps!
Regards
Shong