Delayed camunda jobs

Hi,

I would like to add a job to jobexecutor but with delay.
For Example, after the claim of usertask, it should be send a message in 1 hour after the claim.

It is possible ?

Thanks!

Alex

Hi Alex,

yes, it can be done. Your use case is actually similar to one that has an example online: https://github.com/camunda-consulting/code/tree/master/snippets/task-overdue-job-handler

What this does, is to create a separate, additional job as part of creating the task (in a task listener). The example uses more advanced features, by adding the listeners to all tasks through a parser, but you could also add them manually if you need this functionality only on certain tasks. The job has its own job handler, which contains the implementation of what you would like to do. The job created is scheduled to be executed some time in the future - in your case 1 hour. If the task is completed before the job is due or the task is cancelled, the job is cleaned up so it doesn’t fire unnecessarily. This happens in the other listeners.

1 Like

Hi Tiese,

exactly what i need.
Thanks for precise answer

Alex