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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
_AnonymousUser
Specialist III
Specialist III

tWaitforFile triggers too soon

I need to use the trigger tWaitforFile component and then begin processing that file. The tWaitforFile component doesn't wait for the file to complete the transmission and prematurely begins the next step. tSleep won't help me because the file can be as many as 80 million rows and take an unknown amount of time to finish copying. How can I tell the component to trigger after file is finished?
- Bob
Labels (2)
14 Replies
Anonymous
Not applicable

Hello
The tWaitforFile is used to minitor a folder, if there is a new file created in this folder, it will tigger another action. on the next step, you can do your transmission. Note that, you should run the job first to monitor the folder.
Best regards
shong
_AnonymousUser
Specialist III
Specialist III
Author

Maybe I wasn't clear. I need to use the file in the next step, but it isn't done getting to the folder. How do I make Talend wait until the file is copied completely?
Anonymous
Not applicable

you have to use the tSleep component after your tWaitForFile component, and set it to sleep for as long as it takes for the file to get fully loaded
_AnonymousUser
Specialist III
Specialist III
Author

But I don't know how long to make it sleep. Is there a way to detect if it is done?
Anonymous
Not applicable

Not that I know of...
5484
maybe you could link to a tFileProperties and filter on a certain file size, but then you'd have to loop through (tWaitForFile -> tFileProperties -> tFilterRow) until the file was the size you wanted, so that might not be so helpful
_AnonymousUser
Specialist III
Specialist III
Author

Thank you for opening an issue log. I am sure I am not the only one who would like to see this. I will try the file properties loop as you suggest and hope for an easier component someday.
Anonymous
Not applicable

Anonymous
Not applicable

Bob,
I had the same problem as you, maybe it will help you.
I use tWaitForFile to wait until my report is generated and once it is ready I send it as attachment in e-mail (tSendMail).
I added 1 extra line at the very bottom of script where I generate report to copy created file into the same folder.
I rebuilt my job and I have now:
tWaitForFile_1 --iterate--> tWaitForFile_2 --iterate--> tSendMail_1 --onComponentOk--> tFileDelete_1
In tFileDelete_1 I delete copied file (from tWaitForFile_2).
I hope it helps for you.
Marcin
Anonymous
Not applicable

strpdsnk,
your solution looks more profesional.
Could you provide few lines of code with how it should be written for people who are not experienced in Java, please?
Thanks,
Marcin