Dynamically generate multiple timers


#1

Hi,

Is it possible to generate dynamically multiple timers with timer duedates as a list(iterating over the due date to generate timer events)

Thanks.

Regards,
Vinu S


#2

Hi @vinu_s,

please describe your use case more in detail.

In a BPMN process, you can iterate over a collection using a multi-instance sub-process. A timer event can have an expression as time definition.

Or, you could use the Camunda BPMN Model API to generate the models with the timers.

Best regards,
Philipp


#3

@Philipp_Ossler,

Is it possible to implement this multi instance timer logic inside bpmn parse listener plugin(custom plugin).

If no, how can we achieve the same.

Thanks.

Regards,
Vinu S


#4

No, I think it is not possible to modify the model in this way using a parse listener.

As I said, you can model the multi-instance behavior in the BPMN process. Or, creating the BPMN process dynamically using the model API.

Can you tell more about your process / use case?


#5

@Philipp_Ossler

I have a scenario where i have to create multiple timers dynamically(based on a list of values) in each usertask of a process.

Say i have 10 usertask in a process. i have to create multiple timers in each task.


#6

What should happen when one of the timers fire?
Are the timers related to each other?
Why are there multiple timers?


#7

@Philipp_Ossler

No they are independent timers. once the timer fires it needs to send some kind of notification.


#8

I have no idea for an easy modeling solution. Maybe it’s an option to not model the behavior in the BPMN, instead register an event listener on the user task and manage the timer in the background.