Adding listener to new task created using api

Hello,

First of all, sorry if there is a thread like this one before, but I couldn’t find anything related to it.
I have currently a small application running with Spring Boot, I want to know if is it possible to add a listener (tasklistener) to a new task created using the api, I mean, dynamicallly I’ve created that task using taskService.newTask(). And for that task created, I would like to do something when is created (like the CREATED event) and when it is completed (like COMPLETED event).
I’ve been looking to the reactor extension, I’ve implemented a listener extending the Reactor TaskListener, also one with the ReactorExecutionListener, but non of them get called when the subtask is created/completed (for normal tasks it works perfectly)

Thanks in advance for your advise!

Hi @maitri,

What do you mean by “subtask”? Could you please give us more details on what is your use case and what are you trying to achieve? Do you work with standalone task?

@Yana, for this use case, we need to create subtasks as standalone, using the TaskService.newTask(), as seen in example, and in those task created (without process instance id ) is where I need to have a listener triggered in the creation and completion.

I’m afraid that this is not possible - to create listeners for the standalone tasks, at least not out of the box.
You can attach a create/complete listeners only to the “parent” task which part of the process.