cancel
Showing results for 
Search instead for 
Did you mean: 

task not persisted before TaskListener Event.

atirosselet
Champ in-the-making
Champ in-the-making
I've discovered that while in the task listener, on CREATE or ASSIGNMENT, attempting to get the Task from the TaskService will always result in a null object.  When is the task actually persisted to the database? Only AFTER the task listener has completed?  I had been attempting to lookup the task from the task service in a backend bean, passing only the taskId in, but it appears that this is not feasible.  Can you confirm that this is by design?
1 REPLY 1

trademak
Star Contributor
Star Contributor
In a task listener you get the DelegateTask instance, which you can use to interact with the task itself, so in general it should be necessary to retrieve the task from the TaskService. Yes this is by design, the task will get persisted in the database when the whole transaction is finished, including sending the events.

Best regards,