<?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 tWaitForFile : how to know that no file has been detected in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/tWaitForFile-how-to-know-that-no-file-has-been-detected/m-p/2338285#M106540</link>
    <description>I specified a timeout time (in seconds) in tWaitForFile component&lt;BR /&gt;but at the end, how to know if no file has been detected ?&lt;BR /&gt;I tried a ((Integer)globalMap.get("tWaitForFile_1_CURRENT_ITERATION")) == 0  in a "if" link&lt;BR /&gt;But it dosen't work&lt;BR /&gt;What can I do ?</description>
    <pubDate>Wed, 20 Mar 2013 16:26:49 GMT</pubDate>
    <dc:creator>jmd</dc:creator>
    <dc:date>2013-03-20T16:26:49Z</dc:date>
    <item>
      <title>tWaitForFile : how to know that no file has been detected</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tWaitForFile-how-to-know-that-no-file-has-been-detected/m-p/2338285#M106540</link>
      <description>I specified a timeout time (in seconds) in tWaitForFile component&lt;BR /&gt;but at the end, how to know if no file has been detected ?&lt;BR /&gt;I tried a ((Integer)globalMap.get("tWaitForFile_1_CURRENT_ITERATION")) == 0  in a "if" link&lt;BR /&gt;But it dosen't work&lt;BR /&gt;What can I do ?</description>
      <pubDate>Wed, 20 Mar 2013 16:26:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tWaitForFile-how-to-know-that-no-file-has-been-detected/m-p/2338285#M106540</guid>
      <dc:creator>jmd</dc:creator>
      <dc:date>2013-03-20T16:26:49Z</dc:date>
    </item>
    <item>
      <title>Re: tWaitForFile : how to know that no file has been detected</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tWaitForFile-how-to-know-that-no-file-has-been-detected/m-p/2338286#M106541</link>
      <description>Hi, 
&lt;BR /&gt;Component tWaitForFile provide several globalMaps. 
&lt;BR /&gt;You can get the file name and the number of iterations by using them. 
&lt;BR /&gt;For example, I have designed a job as:tWaitfile--&amp;gt;tjava(see my pic 12). 
&lt;BR /&gt;Get the globalMap in tjava 
&lt;PRE&gt;String filename=((String)globalMap.get("tWaitForFile_1_FILENAME"));&lt;BR /&gt;int Iteration=((Integer)globalMap.get("tWaitForFile_1_CURRENT_ITERATION"));&lt;BR /&gt;System.out.println(filename);&lt;BR /&gt;System.out.println(Iteration);&lt;/PRE&gt; 
&lt;BR /&gt;In tWaitFile, set the "a file is created" as trigger. 
&lt;BR /&gt;At last, when I create files in my directed folder, the result will give "filename" and number of "iteration" to us. 
&lt;BR /&gt; 
&lt;BLOCKQUOTE&gt; 
 &lt;TABLE border="1"&gt; 
  &lt;TBODY&gt; 
   &lt;TR&gt; 
    &lt;TD&gt;but at the end, how to know if no file has been detected ?&lt;BR /&gt;I tried a ((Integer)globalMap.get("tWaitForFile_1_CURRENT_ITERATION")) == 0 in a "if" link&lt;/TD&gt; 
   &lt;/TR&gt; 
  &lt;/TBODY&gt; 
 &lt;/TABLE&gt; 
&lt;/BLOCKQUOTE&gt; 
&lt;BR /&gt;If you want to get the number of detected files, you should define a counter by yourself and the code in 
&lt;A href="https://help.talend.com/search/all?query=tJava&amp;amp;content-lang=en" target="_blank" rel="nofollow noopener noreferrer"&gt;tjava&lt;/A&gt; is 
&lt;PRE&gt;context.counter=context.counter 1;&lt;BR /&gt;System.out.println(context.counter);&lt;/PRE&gt; 
&lt;BR /&gt;(see my pic 3,4,5) 
&lt;BR /&gt;Please refer to my screenshots 
&lt;BR /&gt;Best regards 
&lt;BR /&gt;Sabrina 
&lt;BR /&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MEBY.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/157140i0AD1E5CB8F4EA9B6/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MEBY.png" alt="0683p000009MEBY.png" /&gt;&lt;/span&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009ME4x.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/153925i8FA34C4D953F0848/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009ME4x.png" alt="0683p000009ME4x.png" /&gt;&lt;/span&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009ME8a.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/129198iDE20FE1C0D23B118/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009ME8a.png" alt="0683p000009ME8a.png" /&gt;&lt;/span&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MDvN.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154260i28F76DC5EE49EFFC/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MDvN.png" alt="0683p000009MDvN.png" /&gt;&lt;/span&gt; 
&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009MEBd.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/157429i67016A0425E4B201/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009MEBd.png" alt="0683p000009MEBd.png" /&gt;&lt;/span&gt;</description>
      <pubDate>Thu, 21 Mar 2013 07:53:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tWaitForFile-how-to-know-that-no-file-has-been-detected/m-p/2338286#M106541</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-03-21T07:53:50Z</dc:date>
    </item>
    <item>
      <title>Re: tWaitForFile : how to know that no file has been detected</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tWaitForFile-how-to-know-that-no-file-has-been-detected/m-p/2338287#M106542</link>
      <description>Thanks for your help&lt;BR /&gt;But I found the solution by myself :&lt;BR /&gt;To know if no file has been detected in a  tWaitForFile component after its max duration (sort of timeout), we have to test the "((Integer)globalMap.get("tWaitForFile_1_CURRENT_ITERATION")) == &lt;B&gt;&amp;lt;max iterations&amp;gt;&lt;/B&gt; " in a "if" link</description>
      <pubDate>Thu, 21 Mar 2013 09:40:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tWaitForFile-how-to-know-that-no-file-has-been-detected/m-p/2338287#M106542</guid>
      <dc:creator>jmd</dc:creator>
      <dc:date>2013-03-21T09:40:52Z</dc:date>
    </item>
  </channel>
</rss>

