User task auto to approve

i have create a taskListener in create event.when task is create how to approve this task?
this code alarm error task is already deleted

The only use case to “auto approve” user task I can think about is simulation. TaskListener is not right place for the implementation.
“auto approve” seems like an error business analysis.

Regards
Martin

I have a requirement that the current user task can be automatically approved. How do I implement this? thank you

:warning: don’t use in any circumstances. (there must be problem in business analysis)

Trigger

taskService.complete(taskId)

from another transaction. e.g create a job which will select the tasks to “autocomplete” and complete them.

Regards
Martin