I have a trivial usertask using flowable 5.23:
<userTask id="edit" name="Edit something" activiti:candidateUsers="kermit"></userTask>
When running a process instance, the owner “kermit” is not persisted to the database, i.e. the field ACT_RU_TASK.OWNER_ is always null and consequentially org.activiti.engine.task.Task.getOwner() from my TaskQuery is also null.
Am I missing something?
When I directly assign the task, everything works fine:
<userTask id="edit" name="Edit something" activiti:assignee="kermit"></userTask>
Here the assignee is available from the API
A candidateUser is not the owner of a task which is why the ACT_RU_TASK.OWNER_ field is always null when using the activity:candidateUsers attribute. The candidateUser value is instead stored in the ACT_RU_IDENTITY_LINK table.
On the other hand, the “activity:assignee” attribute does define the owner (or the identity which has been assigned to) a task as would an API call to ‘claim’ a task.
Hope that helps a bit!
thanks for your help, I got it.
I was a bit confused, because I could not find a way to query the candidate users, so I mixed up assignee, owner and potentialOwners, but now I found it: