cancel
Showing results for 
Search instead for 
Did you mean: 

taskService.createTaskQuery().taskId(taskId) return NULL

haynas
Champ in-the-making
Champ in-the-making
Hello Folks,


I'm using a taskService.createTaskQuery().taskId(taskId) to get the task with the specified taskId it works sometimes but the most of the time it returns NULL.

in my code i'm using also taskService.createTaskQuery().processInstanceId(processInst.getId()).list();  and it works perfectly after setting "async" property to false.

Any help will be appreciated.


3 REPLIES 3

hari
Star Contributor
Star Contributor
Hi,

Try it with the below code
taskService.createTaskQuery().taskId(taskId).singleResult();

trademak
Star Contributor
Star Contributor
Hi,

When are you executing the task query? Is it possible that you are encountering a timing issue?

Best regards,

haynas
Champ in-the-making
Champ in-the-making
Thank you for your responses,

it was a timing issue, I should be more carefull