Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tFILEEXIST

Dear Users,
I want to implement the file exist in the dir or no after archival process is over ,
i made the following job:-

0683p000009MCrc.png
Configuration of each component is as follows:-
tfilelist:-

0683p000009MCrc.png
tfileexist:-
0683p000009MCrh.png
if condition:
0683p000009MCpc.png2nd if condition if file dosent exist:-

0683p000009MCrm.png
Its throwing null pointer exception in tfileexist, any idea please help
thanks.
Labels (3)
7 Replies
Anonymous
Not applicable
Author

Hi 
What is the full error message? Can you please upload a screenshot of the whole job?
Regards
Shong
Anonymous
Not applicable
Author

Hi 
What is the full error message? Can you please upload a screenshot of the whole job?
Regards
Shong

Dear shong,
Below is the screen shot of full job:-
0683p000009MCrr.png
Error message:-
Starting job FILE_EXIST at 20:56 06/01/2017.
connecting to socket on port 3726
connected
: sapphire_611.file_exist_0_1.FILE_EXIST - tFileExist_1 null
Exception in component tFileExist_1
java.lang.NullPointerException
at sapphire_611.file_exist_0_1.FILE_EXIST.tFileList_1Process(FILE_EXIST.java:588)
at sapphire_611.file_exist_0_1.FILE_EXIST.runJobInTOS(FILE_EXIST.java:1129)
at sapphire_611.file_exist_0_1.FILE_EXIST.main(FILE_EXIST.java:963)
disconnected
Job FILE_EXIST ended at 20:56 06/01/2017.
Anonymous
Not applicable
Author

I think I have replied you in another topic, this is because you don't use the right global variable, please check it. 
Anonymous
Not applicable
Author

I think I have replied you in another topic, this is because you don't use the right global variable, please check it. 

Dear Shong,
I used the right global variable as said by u
((Boolean)globalMap.get("tFileExists"))
and 
!((Boolean)globalMap.get("tFileExists"))
But i am getting error in tFileexist component
error:null pointer exception
0683p000009MClu.png
I have used the global variable in tfileexist as 
((String)globalMap.get(tFileList_1_CURRENT_FILEPATH))
Anonymous
Not applicable
Author

I used the right global variable as said by u
((Boolean)globalMap.get("tFileExists"))
and 
!((Boolean)globalMap.get("tFileExists"))

Are you sure you input the correct expression? To me, the error is caused by the global variable that does not exist.
The correct expression is:
((Boolean)globalMap.get("tFileExist_1_EXISTS"))
Regards
Shong
Anonymous
Not applicable
Author

I used the right global variable as said by u
((Boolean)globalMap.get("tFileExists"))
and 
!((Boolean)globalMap.get("tFileExists"))

Are you sure you input the correct expression? To me, the error is caused by the global variable that does not exist.
The correct expression is:
((Boolean)globalMap.get("tFileExist_1_EXISTS"))
Regards
Shongif 

Dear Shong,
You are right , there was error in the global variable , i am able to run now .
Now what is happening i am able to check if file is present it says file exist.
But when file is not there it doesn't display file dose not exist.
tfilelist doesn't return anything may be thats why it doesn't display file doesn't exist.
How to handle this?
Anonymous
Not applicable
Author

Hi  
I don't understand your job logic, tfilelist is used to iterate each file that matches the file mark, and you use the current file path on tFileExist to check if the file exist? The result of tFileExist should be always true in your case. 
Regards
Shong