Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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
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
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.
Hope this solves your purpose...!!!!
Regards
Ganshyam
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
Hello,
Check the If condition on tfilelist component global variable nb_file.
((Integer)globalMap.get("tFileList_1_NB_FILE")) <= 0
Regards
Ganshyam
Thanks a lot. Yea missed to try this formula. Appreciated