I have a BPMN flow with timer event which is set for 120 days when process starts.
But for testing perspective I dont want to wait for 120 days to verify the flow. So from camunda operate tool(from camunda cockpit from browser), I went to particular running instance and updated the variable value for timer event for next 2 mins and saved. When page is refreshed new value is shown but it seems job worker did not consider new value and timer event is not triggered.
So the timer event is evaluated using the variable when the token arrives at the timer. So changing the variable wont affect the running timer since it’s already been set.
In Operate you can use process instance modification to move the token past the timer. Or you can use the it to re-trigger the timer with the new variable by removing the current token and creating a new one in it’s place.
Thanks a lot for quick reply.
I tried above solution and that looks working fine, but issue is with above changes we can only verify the timer event.
As you suggested , I have created another token/instance of the process and removed old one. But my old token/instance were having user task. When I tried to submit new user task which i have created with new token I get issue saying process instance not found as we are fetching process data based on process instance key.
as shown in the diagram, there are user task 1, user task 2 and user task 3 and all these has time event. ( all tasks should be finished in specified time). and in the end its notify.
Scenarios:
Process is started, user task 1 is triggered with timer event variable with 120 days. New token is added with lets say timer event for 5 mins and old one is deleted, in such case when notify is called after 5 mins timer event, exception is thrown as process instance for which process is started already deleted.
Process is started, user task 1 is completed and user task 2 is triggered.
when new token is added, it is always added with user task 1. so as I understood, new token/ instance is a fresh instance not the copy of previous one or something.