Skip to main content
August 19, 2021
Question

Recursive timer between hours

  • August 19, 2021
  • 10 replies
  • 1 view

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

    10 replies

    stefanhelzle0001
    Brainy
    August 19, 2021

    Did you test this? hour() returns 0-23. Should be OK.

    August 19, 2021

    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?

    Greetings and thank you

    August 19, 2021

    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?

    Greetings and thank you

    August 24, 2021

    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

    gayathris111098
    August 24, 2021

    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)
    )
    )

    August 24, 2021

    Hello good,


    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?

    A greeting and thanks in advance