Bug 1228853

Summary: The rest query API does not work with variables using camel case when using the "var_" syntax
Product: [Retired] JBoss BPMS Platform 6 Reporter: William Antônio <wsiqueir>
Component: Business CentralAssignee: Shelly McGowan <smcgowan>
Status: CLOSED EOL QA Contact: Lukáš Petrovický <lpetrovi>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.1.0   
Target Milestone: DR1   
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 20:05:00 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 William Antônio 2015-06-05 22:40:49 UTC
Description of problem:

When using the query API to retrieve variable information from process, apparently it does not work to search when using variables that are written using camel case (like docNumber).


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

How reproducible:
Always

Steps to Reproduce:
1. Using business central, create a process with a variable that uses only lower case words(such as name) and another one that uses camel case (such as docId)
2. Add a human task to this process and deploy it; 
3. Make the process wait on the human task(not necessary, you can finish the process if you want) and try to query it using the variables and the rest query API


Actual results:

It will work for the lower case variable, for example:

curl -u 'jesuino:redhat2014!' http://localhost:8080/business-central/rest/query/runtime/process?var_name=william
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><query-process-instance-result><processInstanceInfoList><process-instance><process-id>project1.proc_vars</process-id><id>1</id><state>1</state><parentProcessInstanceId>0</parentProcessInstanceId></process-instance><variables><name>name</name><string>william</string><lastModificationDate>2015-05-22T14:25:43.033-03:00</lastModificationDate></variables></processInstanceInfoList></query-process-instance-result>

But will return nothing for the camel case variable even with the value meeting what was set in the process:

$ curl -u 'jesuino:redhat2014!' http://localhost:8080/business-central/rest/query/runtime/process?var_docId=123
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>


Expected results:

It should bring results for both type of variables.

Additional info:

The query parameters will always be converted to lower case:

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

The documentation, however, has an example using camel case. See 16.1.4.4. Parameter Examples in

https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_BPM_Suite/6.1/html/Development_Guide/chap-Remote_API.html#sect-The_REST_Query_API

var_numCars=10

Perhaps this was not supposed to work, so we should update our documentation?

Comment 2 William Antônio 2015-06-05 22:58:18 UTC
The workaround is to use the varid and varvalue parameters, for example:

$ curl -u 'jesuino:redhat2014!' 'http://localhost:8080/business-central/rest/query/runtime/process?varid=docNum&varvalue=123'

Comment 4 Marco Rietveld 2015-06-26 14:31:03 UTC
Fixed. Commits: 

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

Comment 5 Tomas Livora 2015-09-22 07:44:09 UTC
Verified on BPMS 6.2.0 ER2