cancel
Showing results for 
Search instead for 
Did you mean: 

Create Timer at Runtime

koallen
Champ in-the-making
Champ in-the-making
We have a lot of Human tasks across a number of processes.

What I wanted to know is if it is possible to define a listener at Engine Level that receives all Task Create Events and then creates a timer for each Process or Task as necessary.

When the timer expires the listener also receives the Time expired event and acts as necessary.

The runtime engine does not appear to allow creating timers at runtime, but we don't want to create timers on every task due to the sheer number of tasks.

Is runtime creation possible, if not is there another way to go about this without defining timers on every task ?

Thanks in advance.
2 REPLIES 2

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

I would say that you can follow another approach.
You can add timer to each user task in the phase when process definition is parsed into the memory.
See:
http://www.activiti.org/userguide/#advanced_parseHandlers
org.activiti.engine.impl.bpmn.parser.handler.UserTaskParseHandler
org.activiti.engine.impl.bpmn.parser.handler.TimerEventDefinitionParseHandler

Regards
Martin

Thanks, this appears to fit my use case, I will follow up on your suggestion