Update Timer Cycle at runtime

Hello , I have a process in which a timer has to fire every 24 hours and email to be sent.
Timer Definition Type is Cycle and Definition set to R3/PT24H. I would like to update the Time definition at runtime. Let say the timer triggered at 48 and 72 hours and it was a weekend then I would like the timer to trigger on Monday and Tuesday as well.
Is there a way I could re-set the timer definition for weekends.

Hi @GUNA,

there are APIs to change the due date of a job (which is the date when the timer should fire): Set Job Due Date | docs.camunda.org and Recalculate Job Due Date | docs.camunda.org

There are Java calls available as well: ManagementService (Camunda Platform Javadocs 7.16.0-ee) and ManagementService (Camunda Platform Javadocs 7.16.0-ee)

Hope this helps, Ingo

Hello Ingo , Thankyou for the reply . I tried updating the due date for the job using the rest api. However , I want to understand below scenario.

Let say , I have only one email to send and I have set the timer cycle as R1/PT5M.
So, this timer will fire exactly 5 mins from now and when this happens , I have logic in the outward sequence flow from timer to check if the day is weekend then I make the rest call to update the due date in backend jobs table. However , I want to understand will the timer fire again? Since its already triggered once and then I updated the due date.

Hi @GUNA,

in the situation you described, the timer will not fire again. Once the timer is passed in the process instance, it is removed from the database and cannot be changed.

You can use an expression to evaluate the time directly to the desired moment: ${myCalculatorBean.calculateNextDueDate()}.

You need to implement a bean with the logic in Java-Code: Expression Language | docs.camunda.org and Spring Beans in Processes | docs.camunda.org.

Hope this helps, Ingo