]
Alejandro Guizar resolved JBPM-2637.
------------------------------------
Resolution: Done
TaskMgmtSession.findTaskInstancesByIds() fails if taskInstanceIds is
an empty list
----------------------------------------------------------------------------------
Key: JBPM-2637
URL:
https://jira.jboss.org/jira/browse/JBPM-2637
Project: jBPM
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Runtime Engine
Affects Versions: jBPM 3.2.7, jBPM 3.2.8
Reporter: Toshiya Kobayashi
Assignee: Alejandro Guizar
Fix For: jBPM 3.2.9
Original Estimate: 0 minutes
Remaining Estimate: 0 minutes
org.jbpm.command.GetTaskListCommand.execute() throws JbpmPersistenceException if there is
no pooled task instances for a given actor even if the actor has personally assigned task
instaces.
=====
org.jbpm.persistence.JbpmPersistenceException: couldn't get task instances by ids
'[]'
at org.jbpm.db.TaskMgmtSession.findTaskInstancesByIds(TaskMgmtSession.java:204)
at org.jbpm.db.TaskMgmtSession.findPooledTaskInstances(TaskMgmtSession.java:123)
at org.jbpm.JbpmContext.getGroupTaskList(JbpmContext.java:194)
at org.jbpm.command.GetTaskListCommand.execute(GetTaskListCommand.java:54)
at sample.task.ws.TaskSampleWS.test(TaskSampleWS.java:52)
=====
In case of CP01, GetTaskListCommand returns the personal task list without Exception.
This behavior is caused by the change introduced by r4076 in
org.jbpm.db.TaskMgmtSession.findTaskInstancesByIds().
r4705
===
public List<TaskInstance> findTaskInstancesByIds(List<Long>
taskInstanceIds) {
List<TaskInstance> result;
if (taskInstanceIds.isEmpty()) {
result = Collections.emptyList();
}
else {
try {
Query query =
session.getNamedQuery("TaskMgmtSession.findTaskInstancesByIds");
query.setParameterList("taskInstanceIds", taskInstanceIds);
result = CollectionUtil.checkList(query.list(), TaskInstance.class);
}
catch (Exception e) {
handle(e);
throw new JbpmException("couldn't get task instances by ids '"
+ taskInstanceIds + "'", e);
}
}
return result;
}
===
r4706
===
public List findTaskInstancesByIds(List taskInstanceIds) {
try {
return session.getNamedQuery("TaskMgmtSession.findTaskInstancesByIds")
.setParameterList("taskInstanceIds", taskInstanceIds)
.list();
}
catch (HibernateException e) {
handle(e);
throw new JbpmPersistenceException("couldn't get task instances by ids
'"
+ taskInstanceIds
+ "'", e);
}
}
===
The change was related to JBPM-2205 and removed the empty check because the method
Collections.emptyList() is not supported in jdk1.4. But I think an equivalent empty check
should be restored.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: