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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tWaitForFile - Only works for first iteration

Hello,
I have a job, where I'm loading an Sql database from an Excel file.
The database should be loaded everytime a new excel file is created in a specific directory, so the job has to run everytime a new excel file is created.
The excel file has always the same name.
So, I'm using the followinf flow:
tWaitForFile-----iterate-- -->tFileInputExcel------>tMap------->tMSSqlOutput
The problem is that the only the first file I save in the specific directory is processed, all the other I save there, nothing happens.
Do you have any ideia why this happens?
THanks
RV
Labels (2)
17 Replies
Anonymous
Not applicable
Author

Hi,
unfortunately, there weren't any replies yet. I would be grateful for any suggestions for my problem above.
Thanks!
janhess
Creator II
Creator II

You may need to set the trigger action to updated if the file is not deleted after processing.
Anonymous
Not applicable
Author

Hi All,
I know it is an old topic but still existing problem. I've been fighting with this issue for a while and couldn't find any sensible solution on this forum (which anyway is great!), so I decided to share the solution I've found, maybe it will help someone else in the future.
My workaround is to use an infinite loop to iterate a child job with tWaitForFile placed in it and then iterate the main process. The tWaitForFile is configured to run only once. Find attached the pictures of the process. Ignore the tMap and ContextLoad, they are used to load the filename to a context.
It is simple solution and for me works perfectly!
Anonymous
Not applicable
Author

he database should be loaded everytime a new excel file is created in a specific directory, so the job has to run everytime a new excel file is created.
_AnonymousUser
Specialist III
Specialist III

Hi,
here is another work around similar to kelebek but compact.
just place tInfiniteloop------before tWaitforfile------>tWaitforFile(exit loop when file create)-------->remaining flow.
Even you place file with same name for each iteration, it will work!!!
_AnonymousUser
Specialist III
Specialist III

Hi,
here is another work around similar to kelebek but compact.
just place tInfiniteloop------before tWaitforfile------>tWaitforFile(exit loop when file create)-------->remaining flow.
Even you place file with same name for each iteration, it will work!!!
chafer
Contributor
Contributor

I have "OnComponentOK" from a tSendEmail to the subjob.  I iterate to the tSendMail for the execution and  The email has a global getCurrentDate in the subject line so I get the timestamp of execution.  
tWaitForFile --iterate--> tSendEmail (getCurrentDate)
                                        |  
                              OnComponentOK
                                        |
                                    Subjob
0683p000009MD2p.png
chafer
Contributor
Contributor

Also, the tWaitForFile is on "continues loop" so when a date is added to the file it is watching (a separate job that is output as a web service), this tWaitForFile job picks up that the file was updated and sends another email (iterated line) which kicks off the subjob again. This allows the customer to execute the Talend Job on-demand using a web browser URL without us having to manually start it in Talend.