Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
You want to run ... from startime : 05:00 until 16:30
in tLoop change loop type from FOR into a WHILE,
next copypaste this into condition:
routines.TalendDate.parseDate("HH:mm:ss",routines.TalendDate.getDate("HH:mm:ss") ).before(routines.TalendDate.parseDate("HH:mm:ss", "16:30:00"))
you can leave the int i=0 and int++ as is...
If you want to poll every second... connect via iterate a tSleep.
I've tested above solution and it works!
If not the case I really dont get what you trying to achieve...
Bigdecimal((TalendDate.getdate(“HH”)).compareTo( BigDecimal.valueOf(16) )
Hi
Thanks for responding, I tried that command, below is the exact command i used, actually my job may start around 8 and it has to run until 4.00 PM, with some sleep time in between. so i'm checking the current hour and minutes. for testing purpose i used a different time here,
(Bigdecimal((TalendDate.getdate("HH")).compareTo(Bigdecimal.valueof(10)) == -1 || Bigdecimal((TalendDate.getdate("HH")).compareTo(Bigdecimal.valueof(10)) == 0)))&&(Bigdecimal((TalendDate.getdate("mm")).compareTo(Bigdecimal.valueof(35)) == -1) || (Bigdecimal((TalendDate.getdate("mm")).compareTo(Bigdecimal.valueof(35)) == 0)))
but the job is failing with error
- The method getdate(String) is undefined for the type TalendDate - Bigdecimal cannot be resolved
I put this in a tJava component and run this code.
Date x = routines.TalendDate.parseDate("HH:mm:ss", "12:00:00"); Date y = routines.TalendDate.parseDate("HH:mm:ss", "14:00:00"); System.out.println(y.after(x));
This is more elegant
Sorry, not sure, how can i use this in the tloop?
You want to run ... from startime : 05:00 until 16:30
in tLoop change loop type from FOR into a WHILE,
next copypaste this into condition:
routines.TalendDate.parseDate("HH:mm:ss",routines.TalendDate.getDate("HH:mm:ss") ).before(routines.TalendDate.parseDate("HH:mm:ss", "16:30:00"))
you can leave the int i=0 and int++ as is...
If you want to poll every second... connect via iterate a tSleep.
I've tested above solution and it works!
If not the case I really dont get what you trying to achieve...