Skip to main content
July 5, 2023
Question

Set timer even for process started by startProcess()

  • July 5, 2023
  • 4 replies
  • 0 views

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
    July 5, 2023

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

    linhnAuthor
    July 5, 2023

    Thanks Stefan!

    linhnAuthor
    July 5, 2023

    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
    Brainy
    July 5, 2023

    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.