<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: [resolved] Using tFileList and tWaitForFile both to power the same process... in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-Using-tFileList-and-tWaitForFile-both-to-power-the-same/m-p/2298492#M70945</link>
    <description>Hi shong, 
&lt;BR /&gt;For the job u created if i create one main job in which i use trunjob components twice and call your job as a child job twice , since its monitoring the same folder wont this two child read same files and process it twice how to check file is processed or not with respect to job scenario i have said .. Any solutions to have file check</description>
    <pubDate>Mon, 28 Oct 2013 04:59:03 GMT</pubDate>
    <dc:creator>_AnonymousUser</dc:creator>
    <dc:date>2013-10-28T04:59:03Z</dc:date>
    <item>
      <title>[resolved] Using tFileList and tWaitForFile both to power the same process...</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Using-tFileList-and-tWaitForFile-both-to-power-the-same/m-p/2298485#M70938</link>
      <description>I am just learning Talend, and am a little confused about how to go about this... 
&lt;BR /&gt;I have 2 directories: 
&lt;BR /&gt;FilesToProcess 
&lt;BR /&gt;ProcessedFiles 
&lt;BR /&gt;When Talend first starts up, I want to use tFileList to kick off... so we process any files that have arrived while the job wasn't running. 
&lt;BR /&gt;Then we switch to tWaitForFile for files that arrive while we are up and running... 
&lt;BR /&gt;I have thought of a few hypothetical ways to do this, but they all seem to have problems... 
&lt;BR /&gt;For example: 
&lt;BR /&gt;Use a 'MasterJob' this MasterJob kicks off childJob_tFileList then kicks of childJob_tWaitForFile both of these in turn call childJob_ProcessFile 
&lt;BR /&gt;The problem with this idea, is that if a new file appears during or after childJob_tFileList but before childJob_tWaitForFile, it will not be processed by anyone... until I restart the job that is. 
&lt;BR /&gt;If I could run both tFileList and tWaitForFile in parallel, that would solve this problem, but I'm not sure how to do that. 
&lt;BR /&gt;Another solution would be to periodically run tFileList as a 'clean-up' routine, and process as needed. 
&lt;BR /&gt;There's a million hypothetical solutions, what I'm most interested in, is what an experienced Talend developer would do. 
&lt;BR /&gt;Points that I'm most interested in (confused about): 
&lt;BR /&gt;1. When in this process are sub-jobs recomended? 
&lt;BR /&gt;2. If I want to feed 2 connections main/iterate into a component that only allows one input, is a subjob a good solution? 
&lt;BR /&gt;3. Is it possible / safe to run to Iterate components at the same time (for example the global fileName variable may be being written/read from at the same time by 2 different threads.... 
&lt;BR /&gt;I've searched many pages of documentation, but have found nothing about how Talend handles concurrency, or about accessing variables in a parent job. There is also very little in the way of recommendations as to when to use iterate vs. main links. 
&lt;BR /&gt;I'd appreciate both poinoters on my specific use case, as well as pointers to any documentation that I may have missed to help clarify these points. 
&lt;BR /&gt;Thanks for your help, 
&lt;BR /&gt; -Eric</description>
      <pubDate>Sat, 16 Nov 2024 13:37:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Using-tFileList-and-tWaitForFile-both-to-power-the-same/m-p/2298485#M70938</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T13:37:41Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Using tFileList and tWaitForFile both to power the same process...</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Using-tFileList-and-tWaitForFile-both-to-power-the-same/m-p/2298486#M70939</link>
      <description>Hello Eric 
&lt;BR /&gt; 
&lt;BLOCKQUOTE&gt; 
 &lt;TABLE border="1"&gt; 
  &lt;TBODY&gt; 
   &lt;TR&gt; 
    &lt;TD&gt;If I could run both tFileList and tWaitForFile in parallel, that would solve this problem,&lt;BR /&gt;3. Is it possible / safe to run to Iterate components at the same time (for example the global fileName variable may be being written/read from at the same time by 2 different threads....&lt;/TD&gt; 
   &lt;/TR&gt; 
  &lt;/TBODY&gt; 
 &lt;/TABLE&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt;Yes, running the two subjobs parallelly could be a solution, but some of files maybe be processed two time by two subJobs, so we need check the file if have beend processed first. As my screenshots show, I use a tJava to do that first. 
&lt;BR /&gt;code on tJava_1 
&lt;BR /&gt; 
&lt;PRE&gt;context.condtion1=false;&lt;BR /&gt;String fileName=(String)globalMap.get("tWaitForFile_1_FILENAME");&lt;BR /&gt;if(globalMap.get(fileName)==null){&lt;BR /&gt;context.condtion1=true;&lt;BR /&gt;globalMap.put(fileName,fileName);&lt;BR /&gt;}else{&lt;BR /&gt;context.condtion1=false;&lt;BR /&gt;}&lt;/PRE&gt; 
&lt;BR /&gt;code on tJava_2 
&lt;BR /&gt; 
&lt;PRE&gt;context.condtion2=false;&lt;BR /&gt;String fileName=((String)globalMap.get("tFileList_1_CURRENT_FILE"));&lt;BR /&gt;if(globalMap.get(fileName)==null){&lt;BR /&gt;context.condtion2=true;&lt;BR /&gt;globalMap.put(fileName,fileName);&lt;BR /&gt;}else{&lt;BR /&gt;context.condtion2=false;&lt;BR /&gt;}&lt;/PRE&gt; 
&lt;BR /&gt; 
&lt;BLOCKQUOTE&gt; 
 &lt;TABLE border="1"&gt; 
  &lt;TBODY&gt; 
   &lt;TR&gt; 
    &lt;TD&gt;There is also very little in the way of recommendations as to when to use iterate vs. main links.&lt;/TD&gt; 
   &lt;/TR&gt; 
  &lt;/TBODY&gt; 
 &lt;/TABLE&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt;In short, main link is a flow, it transfer records to next component. Iterate link fires the next subJob base on the number of records, for example: 
&lt;BR /&gt;tFileList--iterate--tJava 
&lt;BR /&gt;if there are 3 files in the directory monitored by tFileList, tJava will be fired 3 time, that means tJava run 3 time. 
&lt;BR /&gt;Best regards 
&lt;BR /&gt; 
&lt;BR /&gt; shong</description>
      <pubDate>Tue, 29 Dec 2009 03:23:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Using-tFileList-and-tWaitForFile-both-to-power-the-same/m-p/2298486#M70939</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-12-29T03:23:05Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Using tFileList and tWaitForFile both to power the same process...</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Using-tFileList-and-tWaitForFile-both-to-power-the-same/m-p/2298487#M70940</link>
      <description>Shong, 
&lt;BR /&gt;Thank you very much. Your reply was very, very helpful. 
&lt;BR /&gt;There are two things here I did not see in the docs: 
&lt;BR /&gt;1. Multi-Threaded execution 
&lt;BR /&gt;2. Condition on (if) link between components. 
&lt;BR /&gt;Are these things documented somewhere? I understand them now, but I think there may be many more features that I have not found the docs for... I think there is a whole section I am missing. 
&lt;BR /&gt;Thanks, 
&lt;BR /&gt; -Eric</description>
      <pubDate>Tue, 29 Dec 2009 04:50:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Using-tFileList-and-tWaitForFile-both-to-power-the-same/m-p/2298487#M70940</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-12-29T04:50:23Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Using tFileList and tWaitForFile both to power the same process...</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Using-tFileList-and-tWaitForFile-both-to-power-the-same/m-p/2298488#M70941</link>
      <description>Hello 
&lt;BR /&gt; 
&lt;BLOCKQUOTE&gt; 
 &lt;TABLE border="1"&gt; 
  &lt;TBODY&gt; 
   &lt;TR&gt; 
    &lt;TD&gt;but I think there may be many more features that I have not found the docs for... I think there is a whole section I am missing.&lt;/TD&gt; 
   &lt;/TR&gt; 
  &lt;/TBODY&gt; 
 &lt;/TABLE&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt;Yes, the documentation is always delay than development, as there are so many developpers than writers. If you join in our forum, you will always learn some userful hint and skills. 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MA9p.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/138034i5F552429DA646D6F/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MA9p.png" alt="0683p000009MA9p.png" /&gt;&lt;/span&gt; 
&lt;BR /&gt;Best regards 
&lt;BR /&gt; 
&lt;BR /&gt; shong</description>
      <pubDate>Tue, 29 Dec 2009 05:02:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Using-tFileList-and-tWaitForFile-both-to-power-the-same/m-p/2298488#M70941</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-12-29T05:02:51Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Using tFileList and tWaitForFile both to power the same process...</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Using-tFileList-and-tWaitForFile-both-to-power-the-same/m-p/2298489#M70942</link>
      <description>Hello ,
&lt;BR /&gt; I have a scenario in which i am taking multiple files from folder and loading it into a table at one shot and recording logs for it at the end of job.but i want to modify it and make it in such a way that 1 file should be picked up from folder ,then it should be loaded and log should be recorded for that particular file ,then same for the next file.....in such a way by seeing the log table i should be able to note which all files are loaded properly ...
&lt;BR /&gt;any suggestions.......</description>
      <pubDate>Thu, 13 Jun 2013 10:44:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Using-tFileList-and-tWaitForFile-both-to-power-the-same/m-p/2298489#M70942</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-06-13T10:44:12Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Using tFileList and tWaitForFile both to power the same process...</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Using-tFileList-and-tWaitForFile-both-to-power-the-same/m-p/2298490#M70943</link>
      <description>Hi 
&lt;BR /&gt;Please open a new topic for your issue, when you login into your account under your home page go to "configuration,usage and feed back" there you can find "post new topic" option.
&lt;BR /&gt;
&lt;BR /&gt;thanks
&lt;BR /&gt;Anil Kumar Burri</description>
      <pubDate>Thu, 13 Jun 2013 10:58:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Using-tFileList-and-tWaitForFile-both-to-power-the-same/m-p/2298490#M70943</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-06-13T10:58:26Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Using tFileList and tWaitForFile both to power the same process...</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Using-tFileList-and-tWaitForFile-both-to-power-the-same/m-p/2298491#M70944</link>
      <description>Sorry posted in the wrong place.</description>
      <pubDate>Wed, 09 Oct 2013 16:15:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Using-tFileList-and-tWaitForFile-both-to-power-the-same/m-p/2298491#M70944</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-10-09T16:15:51Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Using tFileList and tWaitForFile both to power the same process...</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Using-tFileList-and-tWaitForFile-both-to-power-the-same/m-p/2298492#M70945</link>
      <description>Hi shong, 
&lt;BR /&gt;For the job u created if i create one main job in which i use trunjob components twice and call your job as a child job twice , since its monitoring the same folder wont this two child read same files and process it twice how to check file is processed or not with respect to job scenario i have said .. Any solutions to have file check</description>
      <pubDate>Mon, 28 Oct 2013 04:59:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Using-tFileList-and-tWaitForFile-both-to-power-the-same/m-p/2298492#M70945</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2013-10-28T04:59:03Z</dc:date>
    </item>
  </channel>
</rss>

