One Star

Check time: if valid ~> exit loop, else continue loop until valid

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.
so, based on this, I figure I can use some sort of if clause that looks like this (like it is or inversed with !):
TalendDate.getCurrentDate().getHours().equals(0) || TalendDate.getCurrentDate().getHours().equals(1)

But I can't figure out how to design my job so that
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
2. The process drops out of the loop once the above condition is met
would the best thing to do be to use a tJava with a while statement in it?
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
while ( TalendDate.getCurrentDate().getHours() < 2) {
One Star

Re: Check time: if valid ~> exit loop, else continue loop until valid

You can do like this :
tInfiniteLoop ------Iterate-----> tJava -----------RunIf ----------------> Your_job
In tInfiniteLoop set 300. (five minutes)
tJava is empty (need to Iterate something, doesn't work if I plug RunIf directely on tInfiniteLoop)
Runif Condition : !TalendDate.getDate("HH").equals("00")&&!TalendDate.getDate("HH").equals("01")
I have tried, it works well.