Task Listeners and Execution Listeners

Hi All,

We are using multiple camunda process developed using camunda 7.x which are headless (i.e) UI is in angular and backend is taken care by Springboot. Now we want to migrate to camunda 8 but there is no option to handle task listeners and execution listeners which we have used extensively in our project. Below is a use case,

  1. As soon as a process is initiated, we have to insert a record in db with other necessary information. we use execution listeners for this.
  2. once the process is completed, we have to update the process status in app db to completed. again execution listeners are used.
  3. When each task is created, task listener (create) is invoking a java delegate which helps to insert task level information in app db and display the angular ui to users.
  4. Similary when a task is completed, task listener (complete) is used to update the app task status to hide the ui from user and update other information related to tasks.

Now we are in a critical situation, where are not able to proceed further. Can anyone provide a solution for the existing approach?

Hello @syedkp ,

in general, the problem you are facing could be handled by a custom exporter in zeebe. More information here: Exporters | Camunda Platform 8 Docs

However, this is only possible in Self-Managed at the moment.

When using Saas, there are some things you can do to solve the other problems as well:

  1. Instantiate the process instance and use the returned event to save the process instance information in your domain db
  2. Use a message end event and update your domain db in the job implementing the event.
  3. Each task is a job in zeebe, also user tasks. They have a special task type. On user task job activation, you can update your domain db. More information here: User tasks | Camunda Platform 8 Docs
  4. Similar to creating a process instance, you could follow up on a task completion and update your domain db accordingly.

I hope this helps

Jonathan

Why? Just stick to your Camunda 7 solution and wait until there are solutions for the problems. You are not the only one having them.

Thanks @jonathan.lukas . I have taken a look at the links provided though its not straight forward approach happy to know there is a work around.

1 Like

Exactly @fml2 . We are delaying the process of migration until we have a solid solution. so far camunda 7 serves the purpose hope it wont be decommissioned or deprecated in near future.

Hello @syedkp ,

currently, there is no straight-forward solution I fear.

As typical listeners are executed within the command that executes the actual element, this would have to happen inside the engine.

Every solution I presented would happen async from the process execution and therefore might behave differently.

I am also thinking about listeners and how they could become part of Camunda 8.

Please stay tuned. As soon as there is something coming up, this will be big news!

Jonathan

Hi @syedkp,

you can serve your requests with small dedicated changes/extensions and reuse your listener code logic:

You can add an intermediate message throw event after the start to inform your external system that a new process is started. Implement the event with a new task type, using the code from the listener.

Same as the last topic. Use a message end event and move your code from the listener into the job worker. Or insert an intermediate message throw event before the end event. It’s a matter, which state the end event describes.

You can use your own worker for user tasks and put your listener code here. All user tasks are available under the topic io.camunda.zeebe:userTask.

Same as above. Completing the task should go to the worker to complete the task in Zeebe and you can reuse your listener code here.

Hope this helps, Ingo

2 Likes

Thanks @Ingo_Richtsmeier . I will do a POC with the design you have mentioned. This really helps and I am hopeful this will serve as a solution. Thanks once again.

1 Like