Timer with dueDate

Hi,

I was trying to find similar topic but I couldn’t. I have a problem with timers.

My use case: I have a task in which I set due_date for one week. Than after one week I want to send mail reminders to user to finish the task.

I have modeled it like this but I’m not sure if this is a good aproach. I just couldn’t find a better one:

First timer is defined as Date, ${dateTime().plusDays(7).toDate()}. It has a a start execution listener in which I set variable sendMail to true.

Second timer is a cycle and it’s fired every day. But at the beggining sendMail is udenfined or set to false so it won’t send mails.

It works just like I wanted it to work. But isn’t there more simple solution?

Also I have a problem because I have ~100 running instances and I have no idea how to update them to have correct dueDate. I was trying to use due_date variable in timer but I didn’t work. Any ideas?

Hi @katarzyna,

should be possible with a single timer and the ISO8601 standard.
(I didn’t test the configurations)

R/2022-04-27T00:00/P1D

This configuration would start a repetition on the 27th and run it once a day.
You could dynamically calculate the date in the middle via an expression.
Something like:

R/${dateTime().plusDays(7)}/P1D

This could certainly also be possible with a CronJob definition.
Also, you don’t have to model this if you are using a Delegate Expression to send mails. Then you could also configure it via a timeout listener in the UserTask.

regards,
Dominik

2 Likes

Oh wow! That is so simple and that’s exactly what I’ve needed. Thank you :slight_smile:

I do have one more question though. Since I have a lot of running instances I wanted to set this timer to task due date. Is it posibble to do?

My task looks like this:
obraz

And for example I have tasks with due date set to 23.04.2022. If I add a timer with configuration R/${dateTime().plusDays(7)}/P1D than it will fire at 27.04.2022 - 7 days from today. But this is wrong because I need it to fire at 23.04. I have a lot of tasks and they have different due dates so I’ve been thinking about using variable ${due_date} but it doesn’t work. Any ideas?

What I’;ve tried so far:

R/${due_date}/P1D
R/${dueDate}/P1D

But I get an error

Unknown property used in expression

Regards,
Kasia