Bug 1283537 - jbpmHumanTasksWithUser links PeopleAssignments_PotOwners.task_id to AuditTaskImpl.id instead of AuditTaskImpl.taskId
jbpmHumanTasksWithUser links PeopleAssignments_PotOwners.task_id to AuditTask...
Status: VERIFIED
Product: JBoss BPMS Platform 6
Classification: JBoss
Component: Business Central (Show other bugs)
6.2.0
Unspecified Unspecified
urgent Severity high
: CR2
: 6.2.0
Assigned To: Neus Miras
Marián Macik
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-11-19 04:05 EST by Bernard Tison
Modified: 2015-12-01 09:14 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Bernard Tison 2015-11-19 04:05:48 EST
Description of problem:

The jbpmHumanTasksWithUser dataset (which is used to display task lists in the business-central UI) uses the following query:

select  t.activationTime, t.actualOwner, t.createdBy, t.createdOn, t.deploymentId, t.description, t.dueDate,t.name, t.parentId, t.priority, t.processId, t.processInstanceId, t.processSessionId, t.status, t.taskId, t.workItemId, oe.id oeid 
from AuditTaskImpl t, PeopleAssignments_PotOwners po, OrganizationalEntity oe 
where t.id = po.task_id and po.entity_id = oe.id

It links the primary key of the AuditTaskImpl table to the taskId in PeopleAssignments_PotOwners.

So this query assumes that the primary key of AuditTaskImpl is always the same as the taskId. 
With MySQL (I didn't test with other DB's), the primary key of AuditTaskImpl is generated with AUTO_INCREMENT

In my tests with bpmsuite-6.2.0.ER5 with MySQLDB it happened a couple of times that the primary key of rows in AuditTaskImpl was no longer the same as the taskId of the same row. As a result the jbpmHumanTasksWithUser dataset returned erroneous results, breaking the task list UI functionality in business-central. I do not recall the precise conditions in which this mismatch happened, so I cannot reproduce easily.

Possible solution: link AuditTask.taskId to PeopleAssignments_PotOwners.task_id

So the query becomes:

select  t.activationTime, t.actualOwner, t.createdBy, t.createdOn, t.deploymentId, t.description, t.dueDate,t.name, t.parentId, t.priority, t.processId, t.processInstanceId, t.processSessionId, t.status, t.taskId, t.workItemId, oe.id oeid 
from AuditTaskImpl t, PeopleAssignments_PotOwners po, OrganizationalEntity oe 
where t.taskId = po.task_id and po.entity_id = oe.id 

Version-Release number of selected component (if applicable):
bpmsuite-6.2.0.ER5/


How reproducible:
Difficult to reproduce

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:
Comment 4 Marián Macik 2015-12-01 09:14:06 EST
I tried to reproduce it with ER5 and although I had the same primary key and taskId in one row, task list didn't behave correctly. With CR2 everything works as it should. Therefore I am marking this as verified.

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