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
Thirteen Stars

Re: Send Mail IF File not available

Derive On Component error to mail component.

Manohar B
Thirteen Stars

Re: Send Mail IF File not available

did it help you?

Manohar B