<?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: tWaitForFile - Trigger email when no-file or wrong-file in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/tWaitForFile-Trigger-email-when-no-file-or-wrong-file/m-p/2196239#M488</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt; 
&lt;P&gt;When there is no file, you could use tSetGlobalVar to set a variable (e.g. "FileProcessed") to false. Then OnSubjobOK to tWaitForFile with the appropriate time between iterations and max number of iterations. Connect tWaitForFile with iterate to another tSetGlobalVar to set the "FileProcessed" variable to true. Then have RunIf from tWaitForFile to tSendMail with the condition (Boolean)globalMap.get("FileProcessed")==false.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Let us know if it helps.&lt;/P&gt; 
&lt;P&gt;Best regards&lt;/P&gt; 
&lt;P&gt;Sabrina&lt;/P&gt;</description>
    <pubDate>Wed, 21 Aug 2019 08:47:09 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-08-21T08:47:09Z</dc:date>
    <item>
      <title>tWaitForFile - Trigger email when no-file or wrong-file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tWaitForFile-Trigger-email-when-no-file-or-wrong-file/m-p/2196238#M487</link>
      <description>&lt;P&gt;Hello Champs,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Need your help for my issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My requirement:&lt;/P&gt;
&lt;P&gt;I expect “*.csv” as source file. Once the file is in folder the job should transform into required format and drop it to output folder.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My job…&lt;/P&gt;
&lt;P&gt;tFileList --&amp;gt; (iterate) --&amp;gt; tFileInputDelim&amp;nbsp;--&amp;gt; (main)&amp;nbsp;--&amp;gt; tMap&amp;nbsp;--&amp;gt; (out) --&amp;gt; tFileOutputDelim&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;it works great.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My issues:&lt;/P&gt;
&lt;OL&gt;
 &lt;LI&gt;Currently the job runs every 1 hour. Instead, client asked me to make it to run automatically and process it whenever the source file exist in directory.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;I am used “tWaitForFile” to achieve above. I made the job to run first time, and then it picks whenever there is a file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;tWaitForFile&amp;nbsp;--&amp;gt; (iterate)&amp;nbsp;--&amp;gt; &amp;nbsp;tFileList --&amp;gt; (iterate) --&amp;gt;&amp;nbsp;tFileInputDelim&amp;nbsp;--&amp;gt; (main)&amp;nbsp;--&amp;gt; tMap&amp;nbsp;--&amp;gt; (out) --&amp;gt; tFileOutputDelim&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Quest:&lt;/P&gt;
&lt;OL&gt;
 &lt;LI&gt;Is it mandatory to use tSleep?&lt;/LI&gt;
 &lt;LI&gt;Will it impact system (cloud) performance if we use ‘tWaitForFile’? As the component always active.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
 &lt;LI&gt;Client asked me trigger an email when “the file format is wrong” (ie., .xlsx or .txt) or “when there is no file”.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Quest:&lt;/P&gt;
&lt;OL&gt;
 &lt;LI&gt;How do I achieve? “tSendEmail” works fine if I joined to “tFileList” (without using ‘tWaitForFile’ in my flow) , but doesn’t work from “tWaitForFile”.&lt;/LI&gt;
 &lt;LI&gt;If I use “tWaitForFile”, if the source folder is empty, it doesn’t trigger any email as the component still waiting for the file.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks heaps for your help. Happy to answer all your queries.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;K&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 04:57:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tWaitForFile-Trigger-email-when-no-file-or-wrong-file/m-p/2196238#M487</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T04:57:44Z</dc:date>
    </item>
    <item>
      <title>Re: tWaitForFile - Trigger email when no-file or wrong-file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tWaitForFile-Trigger-email-when-no-file-or-wrong-file/m-p/2196239#M488</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt; 
&lt;P&gt;When there is no file, you could use tSetGlobalVar to set a variable (e.g. "FileProcessed") to false. Then OnSubjobOK to tWaitForFile with the appropriate time between iterations and max number of iterations. Connect tWaitForFile with iterate to another tSetGlobalVar to set the "FileProcessed" variable to true. Then have RunIf from tWaitForFile to tSendMail with the condition (Boolean)globalMap.get("FileProcessed")==false.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Let us know if it helps.&lt;/P&gt; 
&lt;P&gt;Best regards&lt;/P&gt; 
&lt;P&gt;Sabrina&lt;/P&gt;</description>
      <pubDate>Wed, 21 Aug 2019 08:47:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tWaitForFile-Trigger-email-when-no-file-or-wrong-file/m-p/2196239#M488</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-21T08:47:09Z</dc:date>
    </item>
    <item>
      <title>Re: tWaitForFile - Trigger email when no-file or wrong-file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tWaitForFile-Trigger-email-when-no-file-or-wrong-file/m-p/2196240#M489</link>
      <description>&lt;P&gt;Hi&amp;nbsp;xdshi,&lt;/P&gt;
&lt;P&gt;Sorry for the delay. Your solution works fine, but it didn't fulfill my requirement (screenshot attached fyr)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) My job should process only CSV file. If any other formats in the folder, then it should trigger an alert email.&lt;/P&gt;
&lt;P&gt;2) (or) if "no file" between 8am-10am then it should trigger an email, saying that "no file found".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried point 1 in your solution. Dropped a non-csv file to the folder, but nothing happened as 'twaitforfile' is waiting for CSV file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does it make sense?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;regards,&lt;/P&gt;
&lt;P&gt;Kiruba&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;A href="https://community.qlik.com/legacyfs/online/tlnd_dw_files/0683p000009Lwj7"&gt;twaitforfile_example.JPG&lt;/A&gt;</description>
      <pubDate>Wed, 02 Oct 2019 21:59:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tWaitForFile-Trigger-email-when-no-file-or-wrong-file/m-p/2196240#M489</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-02T21:59:32Z</dc:date>
    </item>
    <item>
      <title>Re: tWaitForFile - Trigger email when no-file or wrong-file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tWaitForFile-Trigger-email-when-no-file-or-wrong-file/m-p/2196241#M490</link>
      <description>&lt;P&gt;&lt;A href="https://community.qlik.com/s/profile/0053p000007LOltAAG"&gt;@rvkiruba&lt;/A&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Could you please change the file mask to accept all different types of files? Then once the file is identified, you can check the extension of file by storing the file name to a context variable and parse the extension of the file.&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="image.png" style="width: 735px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M7zn.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/142011i0105AC1A8E65A333/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M7zn.png" alt="0683p000009M7zn.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Please use a Run if condition to send the data flow to different paths. If the file is csv, you can follow existing path. If the file is not csv, follow different path where you can send the error email.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Coming to second query, you can do the whole process in a tLoop based on a while condition where the time is between start and end time. You can check the file and go to sleep for predefined interval (say 10 minutes). If you receive a file, set a context flag variable as Y. Even after 10 am, if the file has not reached, the flow will come out of loop and you can check whether flag is Y or N. If the flag is still N, you can send a error email through another Run if flow.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Warm Regards,&lt;BR /&gt;Nikhil Thampi&lt;/P&gt; 
&lt;P&gt;Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved&lt;/P&gt;</description>
      <pubDate>Fri, 04 Oct 2019 16:52:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tWaitForFile-Trigger-email-when-no-file-or-wrong-file/m-p/2196241#M490</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-04T16:52:58Z</dc:date>
    </item>
    <item>
      <title>Re: tWaitForFile - Trigger email when no-file or wrong-file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tWaitForFile-Trigger-email-when-no-file-or-wrong-file/m-p/2196242#M491</link>
      <description>Thanks Nikhil. I will give it a try and get back to you asap.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Kiruba&lt;BR /&gt;</description>
      <pubDate>Fri, 04 Oct 2019 19:25:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tWaitForFile-Trigger-email-when-no-file-or-wrong-file/m-p/2196242#M491</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-10-04T19:25:09Z</dc:date>
    </item>
  </channel>
</rss>

