Dataservice dokument is not deleted when message closes a task

Hi,

we use a message to close the task, see picture. Unfortunately the corresponding dataservice document to the task in the database and the search engine is not deleted. In package com.mgmtp.a12.workflows.event.listeners.task there is no Listener for the camunda delete event which is thrown when the message applies.

Have you got an advice for me, how the dataservice document could be deleted?

Kind regards, Mario

Hi @mario-grand-vale,

You’re right, we don’t have a delete listener to handle that case.

What you could do is to register your own listener for that in Camunda:

@EventListener(condition = "#delegateTask.eventName.equals('delete')")
    fun onTaskDelete(delegateTask: DelegateTask) {
        // ... e.g. taskCompleteHandler.onTaskComplete(delegateTask)
    }

Since you want to same logic we already register on task complete, you can probably reuse our TaskCompleteHandler and simply call that.

Hope that helps!

Best,
Peter

Hi Peter,

thank you for your post, we will implement this way.

Kind regards, Mario