Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
rviard
Contributor
Contributor

Detecting file not found with tFTPGet

Hi,

I have a job that tries to pick up a file from our sftp site every morning. I would like to detect if the file is missing.

The tFTPGet onSubJobOK connects to a fileInputDelimited component. As long as the file is there, it works fine.

 

I connected a tSendMail component that is connected to the OnComponentError of the tFTPGet and should send the error via email using ((String)globalMap.get("tFTPGet_1_ERROR_MESSAGE"))

 

Unfortunately, when I run the job and the file is missing, it always seems to return OK not error (even though I can see the job returning "the system can't file the file specified".)

 

Any idea what I'm doing wrong?

 

TIA.

 

 

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable

"OnComponentError" will only trigger if the component itself fails (e.g. the connection to the ftp site gets closed, or something along those lines). Even though that file was not found, the component still executed successfully. If you're looking to see if a specific file name was processed, you could use the tFTPFileExist component, then check the global var ((Boolean)globalMap.get("tFTPFileExist_1_EXISTS"))

View solution in original post

5 Replies
Anonymous
Not applicable

"OnComponentError" will only trigger if the component itself fails (e.g. the connection to the ftp site gets closed, or something along those lines). Even though that file was not found, the component still executed successfully. If you're looking to see if a specific file name was processed, you could use the tFTPFileExist component, then check the global var ((Boolean)globalMap.get("tFTPFileExist_1_EXISTS"))

rviard
Contributor
Contributor
Author

Ah, OK. That makes sense. Thank you I'll try your suggestion.

cterenzi
Specialist
Specialist

Alternately, you can create a conditional (Run If) link from tFTPGet with a condition like:
((Integer)globalMap.get("tFTPGet_1_NB_FILE")) == 0
rviard
Contributor
Contributor
Author

Thanks, the first solution got the job done, but I'll keep that in mind.

abhi90
Creator II
Creator II

Please mark the solution as accepted whichever helped u