Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tFileDelete dosn't handle failures/errors despite fail on error

Dear Readers,
In our Talend Job there is a tFileDelete component that cleans the content of a directory.
However we need handle the case when at least one file could not be deleted.
When the job executes all files but not the locked ones are deleted. These circumstance
should trigger the mechanism "fail on error" but it is not. The link to "on subjob error"
is not taken by the flow.
Kind regards,
Hilderich
Labels (2)
4 Replies
willm1
Creator
Creator

Do you get failure message in your component though it continues running? You can add a tAssert and a tAssertCatcher to check for this condition and connect it to a tDie to force a kill.
Anonymous
Not applicable
Author

The file delete component is a bit strange designed!
After delete the given file the success can only be seen by this check:
"File deleted.".equals((String) globalMap.get("tFileDelete_1_CURRENT_STATUS"))

This boolean expression can be used in the if trigger.
For me this component is very bad designed. Why they do not have added a usable return value like DELETE_OK or let the component die if it does not work.
Actually if have not seen any difference in the code for fail-on-error. Probably a bug.
Anonymous
Not applicable
Author

Hello All,
We have solved it by Apache's commons-io in particular with
org.apache.commons.io.FileUtils.cleanDirectory enclosed in tJava.
Kind regards,
Hilderich
Anonymous
Not applicable
Author

Also a good solution.