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

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

APIs for Dummies

View this on-demand webinar about APIs....

Watch Now

6 Ways to Start Utilizing Machine Learning with Amazon We Services and Talend

Look at6 ways to start utilizing Machine Learning with Amazon We Services and Talend

Blog

Why Companies Move to the Cloud: 7 Success Stories

Learn how and why companies are moving to the Cloud

Read Now