Eight Stars

FileWatcher in Talend

Hi All,

 

I want to check existance of a file based upon which One of my Child Job will trigger. I have already done with tfileexist giving location of the file. Now I want to keep checking in that location untill and unless that file is available and it will be in loop upto file is available.So basically it will be in an infinite loop. I have placed one tloop where I am placing the condition in while Loop like 

i=1,

!((boolean)globalMap.get(tfile_exists)) =Condition

i++

But the problem is the loop is not working.  I have attached my Job screenshot.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Twelve Stars

Re: FileWatcher in Talend

@abhi90 in this scenario,tWaitForFile will be usefull,please check.

Manohar B
7 REPLIES
Eight Stars

Re: FileWatcher in Talend

Hi,

@vapukov@manodwhb@TRF@rhall_2_0 any help will be appreciated Smiley Happy

Forteen Stars TRF
Forteen Stars

Re: FileWatcher in Talend

Based on your job design, tFileExists is executed only once, so the result of your condition will never change.
Also notice the variable associated to tFileExists is called tFileExists_1_EXISTS (if the component is called tFileExists_1).
So, review your logic and correct the variable name.

TRF
Eight Stars

Re: FileWatcher in Talend

Hi @TRF,
Yeah I using the condition like !(boolean variable of tfileexists). Can you please tell me what logic i will use so that it will keep checking fr the file
Twelve Stars

Re: FileWatcher in Talend

@abhi90 in this scenario,tWaitForFile will be usefull,please check.

Manohar B
Eight Stars

Re: FileWatcher in Talend

Hi @manodwhb,

 

Can you please let me know how to achieve this using tWaitforFile?

Twelve Stars

Re: FileWatcher in Talend

Eight Stars

Re: FileWatcher in Talend

Hi @manodwhb,

 

Your solution worked perfectly. But one thing I did was I kept Exit Loop once File will be created. So untill and unless it was gettting file it was iterating in the directory. Marking the psot as Solved Smiley Happy. Thanks a lotttttt