Bug 990068 - CCE when accessing process variable
Summary: CCE when accessing process variable
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss BPMS Platform 6
Classification: Retired
Component: Business Central
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ER4
: 6.0.0
Assignee: Maciej Swiderski
QA Contact: Radovan Synek
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-07-30 10:28 UTC by Radovan Synek
Modified: 2014-08-06 20:11 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-08-06 20:11:50 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
process definition (6.66 KB, application/xml)
2013-07-30 10:28 UTC, Radovan Synek
no flags Details
server log (99.36 KB, text/x-log)
2013-07-30 10:29 UTC, Radovan Synek
no flags Details

Description Radovan Synek 2013-07-30 10:28:53 UTC
Created attachment 780528 [details]
process definition

Description of problem:
Having process definition with a variable of type Integer. When a process instance is being launched from UI, process variable's initial value is passed into the instance as java.lang.String. When the variable is being accessed (e.g. in script task), CCE is thrown: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer

First time I thought it's a bug in engine and I tested similar scenario without UI. I was able to reproduce the exception only when the process instance was started with parameters where the variable was inserted as String. So I guess there is the same problem. Business-central should initialize process variable correctly according to the variable's type in process definition.

Steps to reproduce:
1. start business-central CR1 on EAP 6.1
2. create / use some project
3. import attached process definition
4. build & deploy the project
5. run new process instance and watch the server log

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

Comment 1 Radovan Synek 2013-07-30 10:29:31 UTC
Created attachment 780530 [details]
server log

Comment 2 Maciej Swiderski 2013-08-26 11:01:55 UTC
Radek, the issue is that you most likely used the default form (you have not created any forms and thus default applied) that is shipped with the runtime and it's only there for demo purpose. You should create forms from within designer and then the variables will be set with correct type.Just tested it with last week build of kie-wb but I believe it was already present for quite long time (since form modeler integration).

So the main rule is to use generate all form from designer for all processes that are modeled, that will ensure correct data types will be used.

Comment 3 Radovan Synek 2013-09-05 13:03:40 UTC
Maciej,

thanks for the clarification. I agree that this is a feature request without clear benefit. On the other hand, user should be aware that this is just a demo form when he opens it. Please add some notifying text to this form so that no one can doubt it is just for demo purposes.

Comment 4 Maciej Swiderski 2013-09-09 17:58:44 UTC
Added information to the automatically generated forms about it's limitation

Committed to master and 6.0.x

master
https://github.com/droolsjbpm/jbpm/commit/fe49c998f2608866711cf4f6a360c697141e2620
6.0.x
https://github.com/droolsjbpm/jbpm/commit/a8499161d31d2cced88c87fc867dcd598f181516

Comment 8 Radovan Synek 2013-10-15 11:59:56 UTC
Verified on BPMS-6.0.0.ER4

Comment 9 Radovan Synek 2014-03-18 16:08:04 UTC
qe_test_coverage: nothing to test, see comment 3 and 4


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