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
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!
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.
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!!!
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!!!
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
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.