Bug 1069622

Summary: ClassCastException when I start a process instance with string parameters containing a number via REST API
Product: [Retired] JBoss BPMS Platform 6 Reporter: Ivo Bek <ibek>
Component: Business CentralAssignee: Maciej Swiderski <mswiders>
Status: CLOSED CURRENTRELEASE QA Contact: Ivo Bek <ibek>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0.1CC: kverlaen, mswiders, rrajasek, rzhang
Target Milestone: ER2   
Target Release: 6.0.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-06 19:50:24 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-02-25 12:21:37 UTC
Description of problem:

I have a process definition which requires two String parameters. I will get ClassCastException when I start the process like this:

http://localhost:8080/business-central/rest/runtime/org.jboss:integration:1.2.0-SNAPSHOT/process/org.jboss.qa.bpms.ScriptTaskTwoVariables/start?map_var1=10&map_var2=20

java.lang.Long cannot be cast to java.lang.String because the numbers are recognized as numbers

I was trying changing the numbers:

http://localhost:8080/business-central/rest/runtime/org.jboss:integration:1.2.0-SNAPSHOT/process/org.jboss.qa.bpms.ScriptTaskTwoVariables/start?map_var1="10"&map_var2="20"

It works but not with the required output:

the variables really contains "10", "20" including the quotes.

A workaround is to start the process via StartProcessCommand and execute REST operation instead.

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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Maciej Swiderski 2014-04-10 16:41:50 UTC
fixed to honor "" as indicator that it should be string even though value might be converted to a number. So using "10" will be kept as string value of 10.

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

6.0.x:
https://github.com/droolsjbpm/droolsjbpm-integration/commit/70f0da47be04fdd6e5580630fc0dd0e53a0ef3a6

Comment 2 Ivo Bek 2014-05-05 09:32:24 UTC
Verified in BPMS 6.0.2.ER2