How to reset boundary timer event on user task in Activiti

enter image description here

In an Activiti process I have a simple user task with a boundary timer event defined with a time duration (e.g. 1h). Using the Activiti API, how can I restart/reset the timer? (The timer should trigger after the time duration from the time on it was restarted.) Here is my sample process definition: By resetting the timer, the time-out handling should be delayed.

asked Jul 18, 2017 at 10:08 Steffen Harbich Steffen Harbich 2,709 2 2 gold badges 42 42 silver badges 74 74 bronze badges Activiti version 6 Commented Jul 18, 2017 at 10:09

1 Answer 1

while I believe you can retrieve the boundary timer event execution and update the timer value using code (I think ive done this int he past but cant find an example right now), I actually prefer the pattern described in this post as it is clear and certainly easy to implement.

If this doesnt satisfy your need, let me know and I will try to dig up the execution update code.

answered Jul 20, 2017 at 15:14 Greg Harley Greg Harley 3,230 1 1 gold badge 12 12 silver badges 14 14 bronze badges

Thank you for your answer. Do you mean managementService.setJobDuedate(jobId, newDueDate) to update the timer via code (copied from comments of linked question)? Firstly, I wonder how I could find out the job ID when I have the task (e.g. Sequential Task 2) at hand? And more important: This method doesn't exist in Activiti 6.0 in ManagementService . Would be cool if you could dig up your code.

Commented Jul 21, 2017 at 5:57 Did you find it again? :) Commented Jul 25, 2017 at 14:12

Did you try getting the job like this: Job job = managementService.createJobQuery().processInstanceId(execution.getProcessInstanceId()).timers().singleResult(); managementService.setJobDuedate(job.getId(), newDueDate);

Commented Jul 25, 2017 at 16:19

Ok, this is how I can get the job, great. However, the method setJobDuedate doesn't exist in ManagementService , see activiti.org/javadocs/6.latest. Do you know if there is an equivalent method for Activiti 6?