<?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 Check time: if valid ~&amp;gt; exit loop, else continue loop until valid in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Check-time-if-valid-gt-exit-loop-else-continue-loop-until-valid/m-p/2247053#M32359</link>
    <description>Ok, I need to set up some sort of catch at the start of one of my processes, that checks TalendDate.getCurrentDate() and if the time is between 12-2am, the process runs a tSleep (for like 5 minutes) and then checks the time again, etc... until the time is no longer between 12-2am. Then I want it to kick off the rest of the process.
&lt;BR /&gt;so, based on this, I figure I can use some sort of if clause that looks like this (like it is or inversed with !):
&lt;BR /&gt;
&lt;PRE&gt;TalendDate.getCurrentDate().getHours().equals(0) || TalendDate.getCurrentDate().getHours().equals(1)&lt;/PRE&gt;
&lt;BR /&gt;But I can't figure out how to design my job so that
&lt;BR /&gt;1. The process loops until the current time is no longer between 12-2am, at which point it continues with the rest of the job
&lt;BR /&gt;2. The process drops out of the loop once the above condition is met
&lt;BR /&gt;would the best thing to do be to use a tJava with a while statement in it?
&lt;BR /&gt;------------------------------------------------------------
&lt;BR /&gt;ok, nevermind, I think I figured it out: I looks like I can use this in a tJava and connect to my next component via a OnSubjobOk
&lt;BR /&gt;
&lt;PRE&gt;while ( TalendDate.getCurrentDate().getHours() &amp;lt; 2) {&lt;BR /&gt;   System.out.println(TalendDate.getCurrentDate());&lt;BR /&gt;   Thread.sleep((20)*1000);&lt;BR /&gt;}&lt;/PRE&gt;</description>
    <pubDate>Sat, 16 Nov 2024 14:13:32 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-11-16T14:13:32Z</dc:date>
    <item>
      <title>Check time: if valid ~&gt; exit loop, else continue loop until valid</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Check-time-if-valid-gt-exit-loop-else-continue-loop-until-valid/m-p/2247053#M32359</link>
      <description>Ok, I need to set up some sort of catch at the start of one of my processes, that checks TalendDate.getCurrentDate() and if the time is between 12-2am, the process runs a tSleep (for like 5 minutes) and then checks the time again, etc... until the time is no longer between 12-2am. Then I want it to kick off the rest of the process.
&lt;BR /&gt;so, based on this, I figure I can use some sort of if clause that looks like this (like it is or inversed with !):
&lt;BR /&gt;
&lt;PRE&gt;TalendDate.getCurrentDate().getHours().equals(0) || TalendDate.getCurrentDate().getHours().equals(1)&lt;/PRE&gt;
&lt;BR /&gt;But I can't figure out how to design my job so that
&lt;BR /&gt;1. The process loops until the current time is no longer between 12-2am, at which point it continues with the rest of the job
&lt;BR /&gt;2. The process drops out of the loop once the above condition is met
&lt;BR /&gt;would the best thing to do be to use a tJava with a while statement in it?
&lt;BR /&gt;------------------------------------------------------------
&lt;BR /&gt;ok, nevermind, I think I figured it out: I looks like I can use this in a tJava and connect to my next component via a OnSubjobOk
&lt;BR /&gt;
&lt;PRE&gt;while ( TalendDate.getCurrentDate().getHours() &amp;lt; 2) {&lt;BR /&gt;   System.out.println(TalendDate.getCurrentDate());&lt;BR /&gt;   Thread.sleep((20)*1000);&lt;BR /&gt;}&lt;/PRE&gt;</description>
      <pubDate>Sat, 16 Nov 2024 14:13:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Check-time-if-valid-gt-exit-loop-else-continue-loop-until-valid/m-p/2247053#M32359</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T14:13:32Z</dc:date>
    </item>
    <item>
      <title>Re: Check time: if valid ~&gt; exit loop, else continue loop until valid</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Check-time-if-valid-gt-exit-loop-else-continue-loop-until-valid/m-p/2247054#M32360</link>
      <description>Hello,&lt;BR /&gt;You can do like this :&lt;BR /&gt;tInfiniteLoop ------Iterate-----&amp;gt; tJava -----------RunIf ----------------&amp;gt; Your_job&lt;BR /&gt;In tInfiniteLoop set 300. (five minutes)&lt;BR /&gt;tJava is empty (need to Iterate something, doesn't work if I plug RunIf directely on tInfiniteLoop)&lt;BR /&gt;Runif Condition : !TalendDate.getDate("HH").equals("00")&amp;amp;&amp;amp;!TalendDate.getDate("HH").equals("01")&lt;BR /&gt;I  have tried, it works well.&lt;BR /&gt;&lt;BR /&gt;José</description>
      <pubDate>Wed, 17 Sep 2008 08:10:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Check-time-if-valid-gt-exit-loop-else-continue-loop-until-valid/m-p/2247054#M32360</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-09-17T08:10:03Z</dc:date>
    </item>
  </channel>
</rss>

