Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
AAA999
Contributor III
Contributor III

Send email when using sequence jobs

I have a workflow/sequence which I am running.

In case one of the job fails I want to send an email with the reason of the failure and the sequence should stop. If successful send an email. I am able to achieve this in individual job but not in sequence

1. Tried the option of check and uncheck die on child error.

2. Added tlogcatcher, tdie, tsendemail component in the same sequence. Nothing works.

Tried options mentioned in the forum. Nothing works. Attached is the screen shot of the job.

3. Is there a way one can create a single reusable  job for sending email using (temail, tlogcatcher etc component) and add it where required.

Help on these would be greatly appreciated

Labels (2)
11 Replies
Anonymous
Not applicable

Hi
1. Check the 'die on error' box on each tRunJob to stop the job as long as one of child jobs has an error.
2. If you want to capture the error and send the error messages in the email, you should use tLogCatcher to capture the error in the child job and send the email.
3. If you are using enterprise edition, you can achieve it by creating joblet which is reusable, this functionality is not available in community edition.

Regards
Shong
AAA999
Contributor III
Contributor III
Author

Hi Shong,

Please see answer below and the attachment

 

1. Check the 'die on error' box on each tRunJob to stop the job as long as one of child jobs has an error.

done


2. If you want to capture the error and send the error messages in the email, you should use tLogCatcher to capture the error in the child job and send the email.

 

I have attached the design for the joblet and the process to send the email.(Email is in the job design and not in the sequence design).Please do let me know what variables needs to be defined in the email message.

Do the reusable joblet needs to be included in all the child jobs or can it be added only in the sequence. Can you please provide an example which would be really helpful.

 


3. If you are using enterprise edition, you can achieve it by creating joblet which is reusable, this functionality is not available in community edition.

we are using enterprise edition.


Email Process.JPG
Joblet.JPG
Anonymous
Not applicable

The joblet will be used in each child job, send email after tLogCatcher which capture the error, the joblet looks like:
tLogCatcher--main--tMap---tJavaRow
|onsubjobok
tSendMail

on tJavaRow, put the error message context variable for used later on tSendMail.
context.error_message=input_row.message;

on tSendmail, set the message filed as below if you want to send the error message.
"The job runs failed, the error message are: "+context.error_message

Hope it helps you!

Regards
Shong
AAA999
Contributor III
Contributor III
Author

Shong,

We have more than 300+ jobs so adding email will be time consuming.

 Is there a way we can add the email notification process in the sequence process only? If the sequence fails send an email with message that sequence 1 has failed .

Thanks

 

Anonymous
Not applicable

Hi
Use a tLogCather in the main job to capture the error and send an email, eg:
tRunjob1-onsubjobok--tRunJob2-->bababab

tLogCatcher--main--tMap--->
|onsubjobok
tSendmail

why you said '2. Added tlogcatcher, tdie, tsendemail component in the same sequence. Nothing works.'? What are your expected result?

Regards
Shong
AAA999
Contributor III
Contributor III
Author

Hi Shong,

I created a joblet and also used the process of sending email directly in the job logic nothing works. Also not able to connect the trigger or row link to the joblet. where to plug in the joblet in the sequence. I am attaching the screen shot. Please, advice what is missing.

Thanks

 


email error job.JPG
email error1.JPG
joblet design.JPG
sequence flow.JPG
tjavarow_job variable.JPG
AAA999
Contributor III
Contributor III
Author

Shong,

Also how to capture additional information generated in the tlogcather when the job fails.

Example

: [template_Log_Catcher_1_tLogRow_5]

2020-04-15 15:31:00|TPg0SC|TPg0SC|TPg0SC|DATAQUALITY|test|Dev|6|Java Exception|tDBOutput_1|java.sql.SQLException0683p000009MA5A.pngRA-01017: invalid username/password; logon denied
|1

It would be really helpful if you could provide a job design

Thanks

Anonymous
Not applicable

The joblet contains tLogCatcher which is the first component of a subjob, you don't need connect any trigger or row link to the joblet, tLogCatcher will capture the error once the job has an error.
Put the joblet in each child job.
I don't understand your question 'Also how to capture additional information generated in the tlogcather when the job fails.'
What do you want? I see you capture the error and send an email with the error message.

Regards
Shong
AAA999
Contributor III
Contributor III
Author

 

The email process is not working when the job fails. The job error is

 tFileInputDelimited_1 - C:\File\jobname (The system cannot find the file specified). When the job fails no email is received. I have attached the main job where I am calling the template email. I have also attached 2 design flow of the template email to show none of the design is working as suggested. Please, have a look at the attachment and suggest what is not correct or if possible can you create a design job. I am attaching the email template design 2 in another post as maximun attachment is 5. Any help would be appreciated

Thanks


joblet design .JPG
Joblet design email value.JPG
joblet design tmap value.JPG
main job.JPG