FileWatcher in Talend

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

 


Accepted Solutions
Highlighted
Moderator

Re: FileWatcher in Talend

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

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.

View solution in original post


All Replies
Highlighted
Eight Stars

Re: FileWatcher in Talend

Hi,

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

Highlighted
Sixteen Stars
Sixteen 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
Highlighted
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
Highlighted
Moderator

Re: FileWatcher in Talend

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

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.

View solution in original post

Highlighted
Eight Stars

Re: FileWatcher in Talend

Hi @manodwhb,

 

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

Highlighted
Moderator

Re: FileWatcher in Talend

please try to implement in this way

https://help.talend.com/reader/iYcvdknuprDzYycT3WRU8w/ENb3YdCeu2TceECJ7RAnTg

Untitled.png

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Highlighted
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

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog