Bug 779197 (SOA-1591) - TaskMgmtSession.findTaskInstancesByIds() fails if taskInstanceIds is an empty list
Summary: TaskMgmtSession.findTaskInstancesByIds() fails if taskInstanceIds is an empty...
Keywords:
Status: CLOSED NEXTRELEASE
Alias: SOA-1591
Deadline: 2010-03-08
Product: JBoss Enterprise SOA Platform 4
Classification: JBoss
Component: JBPM - within SOA, JBPM - standalone
Version: 4.3 CP02
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 4.3 CP04 ER1
Assignee: Alejandro Guizar
QA Contact:
URL: http://jira.jboss.org/jira/browse/SOA...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-11-12 05:34 UTC by Toshiya Kobayashi
Modified: 2010-03-24 09:55 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-03-24 09:55:50 UTC
Type: Bug


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker JBPM-2205 0 None None None Never
Red Hat Issue Tracker SOA-1591 0 None None None Never

Description Toshiya Kobayashi 2009-11-12 05:34:39 UTC
Affects: Release Notes
Date of First Response: 2010-02-25 14:38:20
Help Desk Ticket Reference: https://enterprise.redhat.com/issue-tracker/363931
project_key: SOA

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.

Comment 1 Toshiya Kobayashi 2009-11-12 05:40:12 UTC
Link: Added: This issue related JBPM-2205


Comment 2 Toshiya Kobayashi 2009-11-12 06:00:29 UTC
Link: Added: This issue incorporates JBPM-2637


Comment 3 Anne-Louise Tangring 2010-02-25 19:38:20 UTC
Approved for SOA 4.3 CP03. Please make sure it gets assigned to the appropriate person.

Comment 4 Alejandro Guizar 2010-03-04 08:31:37 UTC
JBPM-2637 is now resolved. SOA-P team, please resolve/close this issue as you see fit.

Comment 5 David Le Sage 2010-03-14 23:39:36 UTC
The draft text for the Resolved Issues section Release Notes states:

https://jira.jboss.org/jira/browse/SOA-1591

    The org.jbpm.command.GetTaskListCommand.execute() would throw a
    JbpmPersistenceException exception if there were no pooled task instances for a given
    actor, even if that actor had been specifically assigned some. This occurred because a check for
    empty lists had been removed as it was no longer supported in JDK 1.4.

    A fix has been applied so that the software now checks
    TaskMgmtSession.findTaskInstancesByIds in order to determine whether or not the
    taskInstanceIds list is empty. As a result, the exception no longer occurs.


Comment 6 Martin Vecera 2010-03-24 09:55:50 UTC
Verified in 4.3.CP03 ER1


Note You need to log in before you can comment on or make changes to this bug.