If a file exists in S3, send an email alert

Five Stars

If a file exists in S3, send an email alert

Hey everyone,

 

I'm creating a simple job that creates a file from an SQL query and puts that Excel file into S3 that will run once a day.  Then if that files gets generated, I want an email alert to be sent out.  My Excel file component is set to Don't generate empty file.  I'm then using a tS3List component to list the file that is generated.  The file name is a database table name + TalendDate.getDate("yyyy-MM-dd").  I'm then using an If with ((Boolean)globalMap.get("tS3List_3")) condition to trigger a tSendMail component.  Will this work or do I need anything else after the tS3List component to complete my check and trigger the email component?

 

Table Check triggle email.JPG


Accepted Solutions
Employee

Re: If a file exists in S3, send an email alert

Hi,

 

    You can change the flow as per the below skeleton flow.

image.png

 

After creating the file, you can verify whether its present using tFileExists component. If the file is present, the If condition will work as true (you need to add the condition in If clause) and then use tS3Put. If the tS3Put is successful, you can trigger the email flow.

 

Please also verify the sample scenario mentioned below to understand the if clause verification method.

 

https://help.talend.com/reader/TxjSzmlJzD3vwT56FYszSA/o5dpZBnobRXdYU1S4wqupg

 

Since you are using OnSubJobOk method, it will be more robust.

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved

View solution in original post


All Replies
Employee

Re: If a file exists in S3, send an email alert

Hi,

 

    You can change the flow as per the below skeleton flow.

image.png

 

After creating the file, you can verify whether its present using tFileExists component. If the file is present, the If condition will work as true (you need to add the condition in If clause) and then use tS3Put. If the tS3Put is successful, you can trigger the email flow.

 

Please also verify the sample scenario mentioned below to understand the if clause verification method.

 

https://help.talend.com/reader/TxjSzmlJzD3vwT56FYszSA/o5dpZBnobRXdYU1S4wqupg

 

Since you are using OnSubJobOk method, it will be more robust.

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved

View solution in original post

2019 GARNER 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

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch 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

Best Practices for Using Context Variables with Talend – Part 3

Read about some useful Context Variable ideas

Blog