Created attachment 610286 [details] test case output Cannot retrieve Boolean variable from Human Task. I have a simple business process with one human task and one Boolean output. Task form generated in Designer creates a check box, but either checking it or leaving it unchecked I receive two different exceptions. How to reproduce: 1. Download and run BRMS 5.3.0 GA patch 01 (I used standalone version with EAP5). 2. Configure your own user (in my case jsvitak) in your jboss-as. You cannot use admin, because this user doesn't work with human tasks (foreign key violation...admin is not the same as Administrator). 3. Download attached test case. 4. Open Designer and create a package named 'com.sample'. Upload to it business process definition file com.sample.boolean.bpmn2 from the test case. Change actor of the human task to your own user, that you created before. Generate task form and .png image for the process and save it. 5. Run attached maven based test case using the command: mvn test -Dtest=HTHandlerBooleanTest 6. Log in to business-central (jbpm-console) by using the credentials of your newly created testing user. 7. You should see one task created by the test case and view it. You can check the check box and you'll receive Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean or you can leave check box unchecked and you'll get NPE. To see the whole stack traces see attached log of the test case. My environment: BRMS 5.3.0 GA patch01 standalone EAP 5 local HSQL database
Created attachment 610288 [details] test case
The same problem occurs when retrieving an Integer process variable. It's from the server log, because the tested business process was launched from Jenkins web application deployed on EAP 5. ... 2012-09-07 11:19:29,429 ERROR [STDERR] (Thread-73) Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer 2012-09-07 11:19:29,429 ERROR [STDERR] (Thread-73) at org.jenkinsci.plugins.jbpm.Process_org_jenkinsci_plugins_jbpm_example.returnValueEvaluator2(Unknown Source) 2012-09-07 11:19:29,429 ERROR [STDERR] (Thread-73) at org.jenkinsci.plugins.jbpm.Process_org_jenkinsci_plugins_jbpm_exampleReturnValueEvaluator2Invoker.evaluate(Unknown Source) 2012-09-07 11:19:29,429 ERROR [STDERR] (Thread-73) at org.jbpm.process.instance.impl.ReturnValueConstraintEvaluator.evaluate(ReturnValueConstraintEvaluator.java:128) 2012-09-07 11:19:29,429 ERROR [STDERR] (Thread-73) ... 23 more
Maciej Swiderski <swiderski.maciej> updated the status of jira JBPM-3779 to Resolved
Maciej Swiderski <swiderski.maciej> made a comment on jira JBPM-3779 Problem is caused by mechanism that console uses to get information about parameters that are transmitted via HTTP. They are always of type String and that's why CCE is thrown. Fix that was applied makes use of DataType definitions to be able to build an object from it's string representation, following is the list of types that are currently supported: - Boolean (java.lang.Boolean) - Integer (java.lang.Integer) - Float (java.lang.Float) - Object (java.lang.Object) - Object (custom class that can be recreated using XStream.fromXML()) When defining type of variable in bpmn2 use either short name, for example Boolean or fqcn java.lang.Boolean Important to note is the way how boolean values must be taken care of when transmitting them from html form over HTTP, as they are usually represented as check box and browser will not send it at all when checkbox is not checked a special hidden input should be placed directly after it <input type="checkbox" name="mycheckbox" value="true"/> <input type="hidden" name="mycheckbox" value="false" /> Some sources recommends to put it before the actual checkbox input field but based on my tests it did not work properly in such configuration as it always replaced the selected value
fix committed into master: https://github.com/droolsjbpm/jbpm/commit/cdd6782505b154cedacd8f589e9f8943d953726f
merged into 5.2.x branch
The reproducer has been tested and it's not fixed in BRMS 5.3.1 ER1. I think it's because Maciej set the bug to MODIFIED when Julian was almost finished with the ER1 build, so probably this bug fix was not included. Setting the state to MODIFIED, and I'll test it with ER2.
Sebastian Calbaza <calbazasebastian> made a comment on jira JBPM-3779 There is an issue with the fix for this (cdd678250) when setting structureRef to "String" in the bpmn definition(ex. <itemDefinition id="_vacaIdItem" structureRef="String" />) and providing a String value in the result mapping. Probably the fix for this issue is adding an if branch in org.jbpm.bpmn2.xml.PropertyHandler for String type.
Maciej, please see comment #8. Returning this back to ASSIGNED.
Meged provided pull request (as part of JBPM-3800) and added additional tests to cover all supported data types.
Verified in BRMS 5.3.1 ER2.
I have updated the information for the Release Notes. Thanks for all the comments regarding the fix. - Doug