1

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: enter image description here

By resetting the timer, the time-out handling should be delayed.

Steffen Harbich
  • 2,639
  • 2
  • 37
  • 71

1 Answers1

2

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.

Activiti / Camunda change boundary timer with variable

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

Cheers, Greg

Greg Harley
  • 3,230
  • 1
  • 11
  • 14
  • 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. – Steffen Harbich Jul 21 '17 at 05:57
  • Did you find it again? :) – Steffen Harbich Jul 25 '17 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); – Greg Harley Jul 25 '17 at 16:19
  • Ok, this is how I can get the job, great. However, the method `setJobDuedate` doesn't exist in `ManagementService`, see https://www.activiti.org/javadocs/6.latest/. Do you know if there is an equivalent method for Activiti 6? – Steffen Harbich Jul 26 '17 at 06:38