Skip to main content
Inspiring
Jul 5, 2023 9:04 AM UTC
Question

Set timer even for process started by startProcess()

Hi everyone, 

I have an interface that contain a submit button to submit a request, that when the submit button is clicked, it will start a process model by a!startProcess() in a!save().

After clicking the submit button, I want that process model to not run until 21:00 that day. How do I set the timer event to achieve that result? The button will be clicked every day, and I want to delay that day's process instances until 21:00 each day, not just 1 single day. I'm not sure how to define the date and time yet. Could any one help?

Thank you!

    4 replies

    stefanhelzle0001
    Brainy
    Jul 5, 2023 9:08 AM UTC

    This is a job for an additional timer event. The timer in the start node is only for scheduled processes.

    linhnAuthor
    Inspiring
    Jul 5, 2023 10:05 AM UTC

    Thanks Stefan!

    linhnAuthor
    Inspiring
    Jul 5, 2023 10:05 AM UTC

    By far I'm able to find the time gap between now and 21:00 ass below: 

    time(21,00)-time(split(split(now()," ")[2],":")[1],split(split(now()," ")[2],":")[2])

    The below expression returns 1:05 as the result. Any idea how can I convert it to minutes (65 minutes)?

    mathieud0001
    Genius
    Jul 5, 2023 10:05 AM UTC

    You could put a timer node in the process but perhaps a slightly more robust design would be to write it to the database and then have a scheduled job run at 21:00 every day and starts a process for each of the new items in the table.