Send Mail IF File not available

Eight Stars

Send Mail IF File not available

I have a scenario. I want to send mail IF File is not available in Linux Directory. Basically It is FileWatcher. If File is available Job is going to Next Component.But IF File not available then It is not sending mails.If Anyone helps will be helpful

Eight Stars

Re: Send Mail IF File not available

Settings of the components attached in the post

Community Manager

Re: Send Mail IF File not available

Hi abhi90

There is a global variable pre-defined on tFileExist component, this variable stores the checking result of a file, you can use this variable as the condition of runIf connector, eg;

tfileExist--runIf1--continue to execute other subjobs

             --runIf2--tSendMail

 

set the condition of runif1 as:

((Boolean)globalMap.get("tFileExist_1_EXISTS"))

 

set the condition of runif2 as:

!((Boolean)globalMap.get("tFileExist_1_EXISTS"))

 

Regards

Shong

 

----------------------------------------------------------
Talend | Data Agility for Modern Business
Eight Stars

Re: Send Mail IF File not available

Hi Shong,

My File is not present in Linux Directory. But for not presence of File in Directory Still Mail not generating.

This is not presence of File

!((Boolean)globalMap.get("tFileExist_1_EXISTS"))

This is presence of File

((Boolean)globalMap.get("tFileExist_1_EXISTS"))

Capture.JPG

Eight Stars

Re: Send Mail IF File not available

In the tfileexist I am using:

((String)globalMap.get("tFTPFileList_1_CURRENT_FILEPATH"))

Community Manager

Re: Send Mail IF File not available

Hi  

With this job design, there should be at least one file matched on tFileList, otherwise, all other components after tFileList will not run. 

 

Regards

Shong

----------------------------------------------------------
Talend | Data Agility for Modern Business
Forteen Stars

Re: Send Mail IF File not available

Derive On Component error to mail component.

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Forteen Stars

Re: Send Mail IF File not available

did it help you?

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.

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 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Why Companies Move to the Cloud: 7 Success Stories

Learn how and why companies are moving to the Cloud

Read Now