Bug 1293308 - Not possible to specify "union" attribute in Task query REST API
Not possible to specify "union" attribute in Task query REST API
Status: ASSIGNED
Product: JBoss BPMS Platform 6
Classification: JBoss
Component: Business Central (Show other bugs)
6.2.0
Unspecified Unspecified
urgent Severity low
: ---
: ---
Assigned To: Shelly McGowan
Lukáš Petrovický
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-12-21 06:40 EST by Anton Giertli
Modified: 2016-09-20 01:14 EDT (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 Anton Giertli 2015-12-21 06:40:22 EST
Description of problem:

$subj:

When I specify multiple variables in the Query REST API, the response includes union of them. There is "union" attribute available, which could be set to false, so the response would include intersection of these variables. However, it is not possible to specify union=true nor union=false when using Query API / task / variables

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


How reproducible:
always

Steps to Reproduce:
http://localhost:8080/business-central/rest/query/runtime/task?vid=var1&vv=1&vid=var2&vv=2&union=false

http://localhost:8080/business-central/rest/task/query?&vid=var1&vv=1&vid=var2&vv=2&union=false

Both queries returns BAD REQUEST. The intention is to display 

All tasks which are bound to a process which fulfills this criteria:
var1=1 && var2=2
Instead (after removing union attr) it returns all tasks which are bound to a process which fulfills this criteria:
var1= || var2=2

and unfortunately this behavior is not changeable.. I have checked the implementation, and there does not appear to be any workaround for this (but I may have be wrong of course..)

Actual results:

It is not possible to set union attribute when using query api with task / variables over the REST
Expected results:
It is possible to set union attribute when using query api with task / variables over the REST

Additional info:
Comment 3 Marco Rietveld 2016-01-08 05:55:38 EST
There are 2 separate issues with this bug: 

1. There is no guarantee of query parameter order by JAX-RS. 

That means that the following REST URL: 

http://localhost:8080/business-central/rest/query/runtime/task?vid=var1&vv=1&vid=var2&vv=2&union=false

is equivalent to: 

http://localhost:8080/business-central/rest/query/runtime/task?vid=var1&vv=2&vid=var2&vv=1&union=false


2. However, because of this, there is the "var_<varName>=<varValue>" syntax in the REST API: 

http://localhost:8080/business-central/rest/query/runtime/process?processinstancestatus=1&var_var1=value1&var_var2=value2

(This syntax has been fixed in https://bugzilla.redhat.com/show_bug.cgi?id=1199993 , as of comm 6.4/prod 6.3. Please read the comments on that bz).
 

Does this syntax address the problem?
Comment 4 Anton Giertli 2016-01-11 09:56:39 EST
Hi Marco,

I have read that other BZ but I am still not quite sure how to achieve the original requirement, which is this:

Having the following query:

http://localhost:8080/business-central/rest/query/runtime/task?vid=var1&vv=1&vid=var2&vv=2

How I am able to specify that:

1) I want to receive all tasks which contains var1=1 && var2=2
2) I want to receive all tasks which contains var1=1 || var2=2

Currently, the behavior described in 2) is implemented by default and is not always desirable. Let me know if I should open formal RFE for this.

Thanks,
Anton

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