Bug 1266553

Summary: TaskQueryBuilder tests failing - missing expression
Product: [Retired] JBoss BPMS Platform 6 Reporter: Tibor Zimanyi <tzimanyi>
Component: jBPM CoreAssignee: Shelly McGowan <smcgowan>
Status: CLOSED EOL QA Contact: Tibor Zimanyi <tzimanyi>
Severity: high Docs Contact:
Priority: urgent    
Version: 6.2.0CC: kverlaen
Target Milestone: ER5   
Target Release: 6.2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-27 19:34:46 UTC 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:

Description Tibor Zimanyi 2015-09-25 15:17:17 UTC
Description of problem: 

Test TaskQueryBuilderCoverageTest.taskQueryBuilderCoverageTest, which is located in module jbpm-human-task fails when executed on supported production DB systems. Exception thrown on Oracle 11gR2 is here: [1]. 

When tested with hibernate.show_sql=true property, it fails on this SQL statement: [2].

The problem is related to empty "IN" clauses. E.g. OR organizati2_.id IN (). 
The solution can be that the IN clauses are not generated when they are empty. 

[1] http://pastebin.com/w59bQ44s
[2] http://pastebin.com/FDaud1XT

Version-Release number of selected component (if applicable):6.2.0.ER3

How reproducible: 

Execute TaskQueryBuilderCoverageTest.taskQueryBuilderCoverageTest on one of supported production database systems.

Comment 1 Marco Rietveld 2015-09-29 07:09:59 UTC
The problem here is that some users will not have groups, but the query is adding a predicate/where phrase that references an empty criteria (no groups). 

The solution is to make sure to only add those clauses (potOwner/stakeHolder/busAdmin in groups) when the user has 1+ groups.

Comment 2 Marco Rietveld 2015-10-28 02:45:19 UTC
Fixed. Commits: 

6.3.x: 
https://github.com/droolsjbpm/jbpm/commit/4b9cf010

master; 
https://github.com/droolsjbpm/jbpm/commit/0987f956

Comment 3 Marco Rietveld 2015-10-28 09:48:03 UTC
These commits were also part of the fix: 

6.3.x: 
https://github.com/droolsjbpm/droolsjbpm-integration/commit/30b35244

master: 
https://github.com/droolsjbpm/droolsjbpm-integration/commit/df5e8743

Comment 4 Tibor Zimanyi 2015-11-10 13:49:03 UTC
Verified in 6.2.0.ER5 by running community test suite on supported DB systems. All failing tests pass now.