The approval for the task needs to be obtained before the declared task start date, otherwise the request is cancelled.
The extra complexity comes from the fact that we can have a parallel “change request”, where the creator says “I’ve changed my mind, let’s delay the start date of a week”.
I have a made a “modifiable timer” that listens to some “date changed” event, but AFIK such custom bpmn cannot be used as boundary event, so that makes the original diagram less elegant
One of the ways is to use an “expression” in each timer like: ${myTimerVariable1} and ${myTimerVariable2}, which searches for the value of the variable to be set, and send the update of the two variables together with the correlated message and with this the timer will be updated.
Hello again, are you saying that the timer “listens” to changes in the variable values even after its initial set-up? So that if I send a message with the variable in the payload to the instance that is waiting for the timer to fire, the timer will update it’s firing time with the new value?
I think that this is not the case. Once the process instance reaches a timer event, a job is created in the database with the due date calculated from the variable value to a specific date. And there is no link back to the variable where the value came from.
So, just updating the variable won’t change the due date. But the setJobDuedate() service that @WilliamR.Alves mentioned above will change the date.
So I imagine there’s no way to have a “pure camunda” solution to update such timer boundary events without some external task that calls back the APIs to set the job date
Maybe you don’t need to create an external task for this, because as you are using Camunda 7, some logic can be done using the execution listner, or even some script task or conditional event.
In the example I gave, you can use a correlated message for the subprocess and within the subprocess have a script task that uses setJobDueDate() to update the timer.
Or even a conditional event that listens when the timer variable is “update” uses setJobDueDate() to update the timer.
Aaaaah, so I believe that the best way to do this is by executing a call to Camunda’s Rest API that you can do in a Script Task and I think in the execution listner as an inline script as well.