[rules-users] named query TasksAssignedAsPotentialOwner doesn't work with MySql db

Frank Knoll Knoll_Frank at web.de
Tue Jun 21 11:07:42 EDT 2011


Hi,

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.

Is this a correct fix?

Cheers, Frank


--
View this message in context: http://drools.46999.n3.nabble.com/named-query-TasksAssignedAsPotentialOwner-doesn-t-work-with-MySql-db-tp3091117p3091117.html
Sent from the Drools: User forum mailing list archive at Nabble.com.



More information about the rules-users mailing list