tFileExist doesn't show message when added tFileList

Six Stars

tFileExist doesn't show message when added tFileList

Hi There,

I have created a simple job to message me whether file/s exists or not in a folder. 

 

Scenario 1: When I used tFileExist with file name, the job works great. I get message 'File exist' or 'No File exist'.

tFileExist --> If --> tMsgBox (FileExist)

                 --> If --> tMsgBox (NoFileExist)

 

Scenario 2: But i want to use a folder where i can expect different files. So i added tFileList component with wildcard and 'Interated' to tFileExist.

But the job never shows neither 'File Exist' nor 'No File Exist', BUT it finishes successfully. (The attached screenshot has all informations).

Is it a product bug? or am i missing something?

 

I have gone thro many articles, cracked my head, but nothing is useful.

 

regards,

Kiruba

 

Community Manager

Re: tFileExist doesn't show message when added tFileList

Hi  

It seems no files are found on tfileList, the other components will not be triggered if there are no files. You need to check the filemask you set.

 

Regards

Shong 

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

Re: tFileExist doesn't show message when added tFileList

Hi Shong,

 

Yes it doesn't have file now, so i expect that tFileExist would trigger the tMsgBox (NoFile) and would say "no file exist". But it is not. 

 

regards,

Kiruba

 

 

 

 

 

Seven Stars

Re: tFileExist doesn't show message when added tFileList

Hello,

 

As you don't have the file in tfilelist component it won't trigger and it will not pass any output to the tfileexist component ,as a result tfileExit won't be able to check the IF condition.

 

Other way out.

 

tfileexists.PNG

 

Hope this solves your purpose...!!!!

Regards

Ganshyam

Six Stars

Re: tFileExist doesn't show message when added tFileList

Wow Ganshyam.

I have replicated as like yours; When the tFileList_1 has file, the job shows me "File Exist" message. But the job gives me below error when no file in tFileList_1

 

Exception in component tFileList_1 (tFileExist)
java.lang.NullPointerException

 

This is what i tried (screenshot attached), 

 

tFileList_1 --> tFileExist_1 --> If =((Boolean)globalMap.get("tFileExist_1_EXISTS"))  --> tMsgBox

|

If =!((Boolean)globalMap.get("tFileList_1_EXISTS"))

|

tMsgBox (NoFile)

 

regards,

Kiruba

Six Stars

Re: tFileExist doesn't show message when added tFileList

NOTE: The option "Generate Error if no file found" hasn't been selected in tFileList.
Seven Stars

Re: tFileExist doesn't show message when added tFileList

Hello,

 

Check the If condition on tfilelist component global variable nb_file.

((Integer)globalMap.get("tFileList_1_NB_FILE")) <= 0

 

Regards

Ganshyam

Six Stars

Re: tFileExist doesn't show message when added tFileList

Thanks a lot. Yea missed to try this formula. Appreciated Smiley Happy

What’s New for Talend Spring ’19

Watch the recorded webinar!

Watch Now

Agile Data lakes & Analytics

Accelerate your data lake projects with an agile approach

Watch

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download

Tutorial

Introduction to Talend Open Studio for Data Integration.

Watch