-
Bug
-
Resolution: Done
-
Major
-
6.4.6
It happens if a custom advanced query[1] returns duplicate records[2] due to the oe_id assigned to it (i.e. user task node is assigned to two groups - manager,developer - and an user is assigned to both groups, it will generate duplicate records in audittaskimpl table:
[1] SELECT ti.*, oe.id as oeid FROM AuditTaskImpl ti, PeopleAssignments_PotOwners po, OrganizationalEntity oe WHERE ti.taskId= po.task_id AND po.entity_id = oe.id;
[2] Records returned after executing query above: id | activationtime | actualowner | createdby | createdon | deploymentid | description | duedate | name | parentid | priority | proc essid | processinstanceid | processsessionid | status | taskid | workitemid | oeid ----+-------------------------+-------------+-----------+-------------------------+--------------+-------------+---------+--------+----------+----------+--------------- -----------------+-------------------+------------------+--------+--------+------------+----------- 1 | 2017-12-28 16:45:50.196 | | | 2017-12-28 16:45:50.196 | pagination | | | Task_1 | -1 | 0 | pagination.myP aginationProcess | 1 | 1 | Ready | 1 | 1 | developer 1 | 2017-12-28 16:45:50.196 | | | 2017-12-28 16:45:50.196 | pagination | | | Task_1 | -1 | 0 | pagination.myP aginationProcess | 1 | 1 | Ready | 1 | 1 | manager 2 | 2017-12-28 16:47:35.549 | | | 2017-12-28 16:47:35.549 | pagination | | | Task_1 | -1 | 0 | pagination.myP aginationProcess | 2 | 1 | Ready | 2 | 2 | developer 2 | 2017-12-28 16:47:35.549 | | | 2017-12-28 16:47:35.549 | pagination | | | Task_1 | -1 | 0 | pagination.myP aginationProcess | 2 | 1 | Ready | 2 | 2 | manager (4 rows)
Then by calling rest endpoint [3] to the custom registered query, it is internally converted by dashbuilder API or kie-server to the following query [4] which applies some filters:
[4]
16:48:56,654 DEBUG [org.dashbuilder.dataprovider.sql.JDBCUtils] (http-192.168.1.101:8080-2) SELECT id, activationtime, actualowner, createdby, createdon, deploymentid, description, duedate, name, parentid, priority, processid, processinstanceid, processsessionid, status, taskid, workitemid, oeid FROM (select ti.*, oe.id as oeid from audittaskimpl ti, peopleassignments_potowners po, organizationalentity oe where ti.taskid= po.task_id and po.entity_id = oe.id) AS "dbSQL" WHERE (actualowner = 'brmsuser' OR (oeid = 'admin' OR oeid = 'analyst' OR oeid = 'developer' OR oeid = 'manager' OR oeid = 'kie-server' OR oeid = 'brmsuser')) LIMIT 4
Note: getAllTaskInstancesWithCustomVariables4 is the advanced custom query registered against kie-server.
Result: This rest endpoint displays only one task in page=0 and the other task result in page=1. It should display the two tasks in page=0 since pageSize passed is 4.
The root caused is explained by William in this comment.
- clones
-
RHPAM-365 Pagination displays incorrect amount of tasks when custom advanced query returns duplicate records in BPM Suite 6.4
- Closed