Good Morning,
We are trying to configure a timer in the start node of a process that must have the following functionality, the process must run every 15 minutes every day between 04:00 AM and 06:00 AM.( that is, 9 times)
We have GMT (-3:00) so we were trying to do it as follows,
But I understand that with this condition it will run at both 04:00 PM and 04:00 AM
Would you have any ideas to help us?
Greetings and thank you
Discussion posts and replies are publicly visible
Did you test this? hour() returns 0-23. Should be OK.
Right, excuse me and a question I am putting the condition in a rule because the values of StartDate, EndDate, I must frequently collect them from the database, the rule is this:
load(
local!horaIni: split( local!fechaIni, ":" )[1], local!minutoIni: split( local!fechaIni, ":" )[2], local!horaFin: split( local!fechaFin, ":" )[1], local!minutoFin: split( local!fechaFin, ":" )[2], /*Se comprueban las condiciones para ver si el proceso debe ejecutarse o no*/ if( and( time( hour( local( now() ) ), minute( local( now() ) ) ) >= time( local!horaIni, local!minutoIni ), time( hour( local( now() ) ), minute( local( now() ) ) ) <= time( local!horaFin, local!minutoFin ), local!activo = "S" ),true(), false() ))
Where the values of startDate, EndDate and asset are values retrieved from bbdd(values are string)
and the frequency would be a query to bbdd that retrieves this value
This is the timer setting
Executing the rule separately returns true
Do you know why the process does not start?
We have continued doing tests and we have seen that the condition in the node does not do well, if it has a load or with the queries to bbdd, it only works well if we put the values in constants but what they ask us is that those values are in bbdd, any ideas?
Hello good,
With hours we already achieve it but with minutes not, if we put the following code the timer does not run, do you know what the problem may be?
and( ( time( hour( local( now() ) ), minute( local( now() ) ) ) >= time( 3, 0 ) ), ( time( hour( local( now() ) ), minute( local( now() ) ) ) <= time( 5, 30 ) ))
A greeting and thanks in advance
Give a try like this, From 3AM to 5.30PM it should return true
and( ( time( now() ) >= time(3, 0) ), ( time( now() ) <= time(17,30) ))
Thanks for the answer, but I think it is useless if I do that, the hours do not match the local time, for example:
So I think I would not run the timer at the correct time.
Or is it something i'm not doing correctly?
Have you tried just not using local time but using GMT instead? Personally I find it difficult to keep up with what the local time is and it's often easier to just move the time to GMT instead.
Hi Peter!
It is that the client wants the start date and the end date to be stored constant and they do not want to be calculating the time in gmt.
Ah okay - is the local time zone likely to change? You could still offset the time from that constant to GMT to make the calculations easier.
You can change the time you want the process to run.I do not quite understand what you are proposing.Can you explain a bit to me?