Event listener after some time of task completion

Hello, how you would recommend me implementing a situation when the task is successfully completed, something was done because of that and after some time interval has to be something what was done undone (again has to be created task). Interval I already know when is first task created, dynamic in months usually (e.g. 6 months, 1 year).

What comes to my mind is something like:

When is task completed, save it to own database with time interval and then periodically (in endless cycle?) get all of them not handled yet (bool variable), read time interval, check whether is time to be undone what was done and in case yes then create task that. But I feel like exists a better solution.

Thank you for directing me in the right way

Lukas

Hi and welcome.
I’m not totally sure if I understand your question correctly, but I think you want a timer event in your process definition (your process instance is stil running right?).
Here a short example for something like that:


For the timer event you can then choose a duration and use an expression for the calculation e.g. a process variable: ${calculatedDuration}

I like this approach. What I want is to find an appropriate solution to automate creating undone tasks so will not have to be created manually AND will not be forgotten about them, that is all. One question, do not will be a problem with a lot of unfinished processes (timer will be in months even 1 - 2 years), because if I understand well, timer will stop process from finishing until undone task will be processed.

As always the answer is: It depends.
Not running processes are not actively using resources like CPU or RAM, but of course the entries in the database will remain until the process is finished and depending on your history level and time to live even after that.
So the question is really, how many process instances will you have and how much history and database entries due to activities do they produce.
But there can be a lot of unfinished processes in the database without a huge impact, if your database is scaled accordingly.