named query TasksAssignedAsPotentialOwner doesn't work with MySql db
When I add a task (having two potential owners) by calling the method addTask followed by calling the method getTasksAssignedAsPotentialOwner of org.jbpm.task.service.TaskClient I expect to receive a list of TaskSummaries containing at least the previously added task. But I actually get an empty list!
Here is my setup and possible solution:
I am using the trunk version of ./jbpm-human-task/src/main/resources/META-INF/orm.xml and a MYSQL database.
When calling addTask the Task table will be populated with a NULL actualOwner_id.
The named query TasksAssignedAsPotentialOwner
"select new org.jbpm.task.query.TaskSummary(...t.taskData.actualOwner...) from ... left join t.taskData.actualOwner ..." of orm.xml generates SQL consisting of an inner join "inner join OrganizationalEntity user7_ on task0_.actualOwner_id=user7_.id" which doesn't take the NULL actualOwner_id correctly into account.
When I replace the named query TasksAssignedAsPotentialOwner with
"select new org.jbpm.task.query.TaskSummary(...actualOwner...) from ...left join t.taskData.actualOwner as actualOwner ...", then the generated SQL consists of an "left outer join OrganizationalEntity user2_ on task0_.actualOwner_id=user2_.id" which takes the NULL actualOwner_id correctly into account. So I get a List of TaskSummaries containing the added task.