Unable to send mail for file not exists

Six Stars

Unable to send mail for file not exists

Hi Guys

I am new to Talend.Please help me out to solve my issue

I have multiple files in FTP server(xlsx).

Now i need to send a mail if file not exists. if file is present i need to run my job.

 

i used two if conditions, but that is working in opposite direction

xlsx file exists(FTP)- it is sending mail

csv file not exists(FTP) - it is sending mail.

 

tftpfileexist_1 ----if (order:1)   !((Boolean)globalMap.get("tFTPFileExist_1_EXISTS"))  --sendmail

tftpfileexist_1 ----if (order:2)  ((Boolean)globalMap.get("tFTPFileExist_1_EXISTS"))  ---job has to run

 


Accepted Solutions
Thirteen Stars

Re: Unable to send mail for file not exists

@Lakshmi2411,still do you have issue?

Manohar B
Six Stars

Re: Unable to send mail for file not exists

Got it.Tnks.

I wrote  ((Integer)globalMap.get("tFileList_1_NB_FILE"))<0

it got worked.

 


All Replies
Thirteen Stars

Re: Unable to send mail for file not exists

@Lakshmi2411,i have tested below one is working as expected.use below way.

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

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

Untitled.png

 Untitled.png

Manohar B
Thirteen Stars

Re: Unable to send mail for file not exists

@Lakshmi2411,still are you facing the issue?

Manohar B
Six Stars

Re: Unable to send mail for file not exists

Hi
Plese help me out.
Even Though file exists is is send mail..
Here I am using File list,so that it can retrieve multiple files with xlsx exists or not .

 

 

Thirteen Stars

Re: Unable to send mail for file not exists

@Lakshmi2411,since you can use tFilelist,but you need to iterate the flow.check the below way.

Untitled.png

Manohar B
Six Stars

Re: Unable to send mail for file not exists

-Finaally i have to achieve if files with xlsx it has run the job
if files are not present with xlsx it has send mail.
-can't we achieve my scenario with this condition.
-((Integer)globalMap.get("tFTPFileList_1_NB_FILE"))==0
Thirteen Stars

Re: Unable to send mail for file not exists

@Lakshmi2411,

 

you can do  the below way that 

((Boolean)globalMap.get("tFileExist_1_EXISTS"))==true && ((Integer)globalMap.get("tFTPFileList_1_NB_FILE"))>0

 

 

 

 

Untitled.png

Manohar B
Thirteen Stars

Re: Unable to send mail for file not exists

@Lakshmi2411,still do you have issue?

Manohar B
Six Stars

Re: Unable to send mail for file not exists

Got it.Tnks.

I wrote  ((Integer)globalMap.get("tFileList_1_NB_FILE"))<0

it got worked.

 

Thirteen Stars

Re: Unable to send mail for file not exists

@Lakshmi2411,you were wellcome.Please provide Kudos also.

Manohar B