Bug 1008824

Summary: Avoid task duplicates when querying for tasks
Product: [JBoss] JBoss Enterprise BRMS Platform 5 Reporter: Toshiya Kobayashi <tkobayas>
Component: jBPM 5Assignee: Kris Verlaenen <kverlaen>
Status: VERIFIED --- QA Contact:
Severity: high Docs Contact:
Priority: unspecified    
Version: BRMS 5.3.1CC: abhumbe, ajuricic, nwallace
Target Milestone: GA   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1053793 (view as bug list) Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1026838, 1018173    
Bug Blocks: 1022758    
Attachments:
Description Flags
jBPMEx109_getTasksAssignedAsPotentialOwner_BZ none

Description Toshiya Kobayashi 2013-09-17 07:00:38 UTC
Description of problem:

Backport https://issues.jboss.org/browse/JBPM-3866

JBPM-3866 has been addressed by 'group by' at first (commit: e8fbea998621608f02cac6f8963a41a18bb80b36) but now addressed by 'distinct' (commit: 11743329deb101bbb7e26a11f7ae49afa0f24086)


Steps to Reproduce:
1. Create a process with a User Task which has both actorId (="john") and groupId (="PM") 
2. Start a process and let it create a Task
3. call getTasksAssignedAsPotentialOwner with userId and groupIds

        List<String> groupIds = new ArrayList<String>();
        groupIds.add("PM");
        List<TaskSummary> list = localTaskService.getTasksAssignedAsPotentialOwner("john", groupIds,  "en-UK");
        System.out.println("list.size() = " + list.size());

Actual results:

list.size() = 2

Expected results:

list.size() = 1

Comment 1 Toshiya Kobayashi 2013-09-17 08:38:46 UTC
Created attachment 798674 [details]
jBPMEx109_getTasksAssignedAsPotentialOwner_BZ

Comment 2 Toshiya Kobayashi 2013-10-02 07:19:19 UTC
Just adding 'distinct' fails in Oracle because Oracle doesn't accept CLOB columns (name.text, subject.text, description.text) for distinct.

Need to use I18NText.shortText like implemented in master as well.

Comment 3 Toshiya Kobayashi 2013-10-11 11:23:11 UTC
If you fix this BZ with 'distinct' + I18NText.shortText, you also need to backport BZ1018173 to BRMS 5.3.x branch because I18NText.shortText has a defect which is decribed in the BZ.

Comment 4 Maciej Swiderski 2013-11-18 19:14:31 UTC
backported to 5.2.x branch:
https://github.com/droolsjbpm/jbpm/commit/751dfcb907cc26721b54ebad6d2fd2c17a19fffd

this includes usage of distinct and change of text to shortText to all I18NText fields used in the queries.

Comment 5 Radovan Synek 2014-02-13 17:16:17 UTC
Verified with BRMS-5.3.1-P05