Task create listener problem

Hi there!

I’ve got a problem with implementing task listener logic.
What I’m trying to do is to notify client on new task by sending message queue event.
The problem is that when client handles the message and try to fetch task, API returns 404, the task isn’t yet exists. I thought that my problem is that listener called inside a transaction, and client makes call when it isn’t finalised yet.
I need something like “afterCreate” event, when task is already ready.
Please, help!

@errd you can configure the task listener in the UserTask activity of the eventType = “create”

The create event fires when the task has been created and all task properties are set. No other task-related event will be fired before the create event.

Read about the life cycle events of task-listener-event-lifecycle.

event (required) : the type of task event on which the task listener will be invoked. Possible events are: create , assignment , update , complete , delete and timeout ;

https://docs.camunda.org/javadoc/camunda-bpm-platform/7.12/?org/camunda/bpm/engine/impl/TaskServiceImpl.html

Thank you, it is clear now!