Bug 1174828

Summary: Unknown and unsupported (composed) query params in REST API
Product: [Retired] JBoss BPMS Platform 6 Reporter: Ivo Bek <ibek>
Component: Business CentralAssignee: Shelly McGowan <smcgowan>
Status: CLOSED EOL QA Contact: Ivo Bek <ibek>
Severity: high Docs Contact:
Priority: urgent    
Version: 6.1.0CC: alazarot, kverlaen, mbaluch
Target Milestone: ER6Keywords: TestBlocker
Target Release: 6.1.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:42:49 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 Ivo Bek 2014-12-16 14:53:42 UTC
Description of problem:

According to https://github.com/mrietveld/droolsjbpm-integration/wiki/jBPM-Rest-Query-API ... it should be possible to use parameters like: var_myobject, enddate_min, startdate_min, enddate_max, varregex_myobject, and others but when I use any of them, the request will fail with:

Exception thrown when processing request [/query/runtime/process?processinstancestatus=1&startdate_max=15:39:13&]; responding with status 400: org.kie.remote.services.rest.exception.KieRemoteRestOperationException: startdate_max is an unknown and unsupported query param for the /business-central/rest/query/runtime/process operation.
	at org.kie.remote.services.rest.exception.KieRemoteRestOperationException.badRequest(KieRemoteRestOperationException.java:104) [kie-remote-services-6.2.0.CR3-redhat-1.jar:6.2.0.CR3-redhat-1]
	at org.kie.remote.services.rest.QueryResourceImpl.checkIfParametersAreAllowed(QueryResourceImpl.java:164) [kie-remote-services-6.2.0.CR3-redhat-1.jar:6.2.0.CR3-redhat-1]
	at org.kie.remote.services.rest.QueryResourceImpl.queryProcessInstances(QueryResourceImpl.java:77) [kie-remote-services-6.2.0.CR3-redhat-1.jar:6.2.0.CR3-redhat-1]
	at org.kie.remote.services.rest.QueryResourceImpl$Proxy$_$$_WeldClientProxy.queryProcessInstances(QueryResourceImpl$Proxy$_$$_WeldClientProxy.java) [kie-remote-services-6.2.0.CR3-redhat-1.jar:6.2.0.CR3-redhat-1]


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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 4 Marco Rietveld 2015-01-19 16:09:50 UTC
One more commit for a test fix. Commits: 

6.2.x:
https://github.com/droolsjbpm/droolsjbpm-integration/commit/c1ac7234

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

Comment 5 Ivo Bek 2015-02-17 12:39:20 UTC
Verification failed in BPMS 6.1.0.ER5

The issue persists, see:

responding with status 400: org.kie.remote.services.rest.exception.KieRemoteRestOperationException: varregex_myobj is an unknown and unsupported query param for the /business-central/rest/query/runtime/task operation

I believe that's because "checkSpecial" parameter is not set to true in runtime/task and runtime/process operations during checkIfParametersAreAllowed(params, QueryResourceData.getQueryParameters(), oper);

I would say that there should be:

checkIfParametersAreAllowed(params, QueryResourceData.getQueryParameters(), true, oper);

on these places:

https://github.com/droolsjbpm/droolsjbpm-integration/blob/c724f38f5aa98eb2f4420481298d880ea4af71a5/kie-remote/kie-remote-services/src/main/java/org/kie/remote/services/rest/QueryResourceImpl.java#L60

https://github.com/droolsjbpm/droolsjbpm-integration/blob/c724f38f5aa98eb2f4420481298d880ea4af71a5/kie-remote/kie-remote-services/src/main/java/org/kie/remote/services/rest/QueryResourceImpl.java#L78

Comment 6 Marco Rietveld 2015-02-17 15:36:54 UTC
Ivo, good catch, thank you for taking the time to find the cause as well!

Also, my apologies: this was a stupid mistake! 

Fixed. Commits: 

6.2.x: 
https://github.com/droolsjbpm/droolsjbpm-integration/commit/caf0a03c

master: 
https://github.com/droolsjbpm/droolsjbpm-integration/commit/4b0c075b

Comment 7 Ivo Bek 2015-03-05 15:11:38 UTC
Verified in BPMS 6.1.0.ER6