Four Stars

Restart job after tsleep****

Hi ,

 

I have a tlist folder I am reading from which has 3 iterations. Iteraration1(Order1) and Iteration2(Order2). Order1 looks for a specific file in the directory, if the file is not found sleeps for 2hours(tsleep). After it  sleeps for 2hours, I want to re-start from re-reading the tFileList and go to Iteration1 again and look for the file. The problem ow is I cant figure out a way to connect my tsleep to tfilelist. I have attached screenshot. Will my problem be solved if I used a "tWaitforFile" instead? My file name is stored in a column in tlogRow, how will I assign that column's value to FileName in file watcher?

 

You help id greatly appreciated. I am very new to Talend. 

 

3 REPLIES
Twelve Stars

Re: Restart job after tsleep****

Four Stars

Re: Restart job after tsleep****

Hi,

 

Thanks for the response. I tried it. It works , however it did not give me the expected result. I have two files in tFileList. And the tloop iterates 10 times ( from 1 to 9). The problem is that instead of running 10 times, it runs 20 times, once for each file. If I change the connection to "On Component OK", it only loops twice. Not sure what's wrong. 

Twelve Stars

Re: Restart job after tsleep****

You picture is not full, so it hard to say - what wrong

 

but it work as expected, if

  • Loop component is first in the Job, it response for number of iterations, and not important how many files in folder - out will run all process exactly defined number of iterations
  • then in Your job You are must mange following steps
-----------