Bug 1082091 - ClassCastException for ConnectTimeout REST WorkItem/Service Task input parameter
Summary: ClassCastException for ConnectTimeout REST WorkItem/Service Task input parameter
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss BPMS Platform 6
Classification: Retired
Component: jBPM Core
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ER1
: 6.0.2
Assignee: Maciej Swiderski
QA Contact: Jiri Svitak
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-03-28 16:15 UTC by Alessandro Lazarotti
Modified: 2018-12-05 17:55 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
A REST service task added to a process would cause errors on deployment with a ClassCastException error with an assignemnt set for the URL property. The error was caused due to incorrect typing of DataInputSet properties for the URL like ConnectTimeout and ReadTimeout. This issue has now been fixed.
Clone Of:
Environment:
Last Closed: 2014-08-06 19:50:04 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker JBPM-4278 0 Major Resolved ClassCastException for ConnectTimeout REST WorkItem/Service Task input parameter 2018-12-05 19:20:29 UTC

Description Alessandro Lazarotti 2014-03-28 16:15:40 UTC
Description of problem:

##### Platform BZ for https://issues.jboss.org/browse/JBPM-4278


Steps to Reproduce:


    -Create a process
    -Add start node
    -Drag a REST Service Task
    -Drag end node
    -Connect all three so start node moves to REST, then moves to end
    -Click on REST service task and expand properties
    -Open Assignments and note that there is no assignment for Url, even though all other parameters are there
    -Add assignment for Url and set "is equal to" the Url for a REST service
    -Set Method parameter appropriately (e.g. "is equal to" POST or GET)
    -Build/deploy process
    -Go to Process Management -> Process Definitions and click "start"
    -Note that exception is thrown: "java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer"
    -Go back to process definition and edit DataInputSet property
    -Change "Standard Type" of ReadTimeout and ConnectTimeout from "String" to "Integer"
    -Build/Deploy process
    -Try to start process again, which should result in same exception.
    -Go back to process definition and edit Assignments property
    -Set a value for both ReadTimeout and ConnectTimeout (e.g. 6000)
    -Build/Deploy process
    -Try to start process again, which should result in same exception.



Actual results:
 java.lang.ClassCastException

Expected results:
 Process working

Additional info:

Comment 2 Kris Verlaenen 2014-04-01 00:41:21 UTC
Maciej, could you check the Url issue?  

ReadTimeout and ConnectTimeout are (currently) defined as Integers, so filling in a value in "hard-coded" assignments in process will generated a CCE as expected.  A workaround would be to use an on-entry script to set an integer variable to the value wanted and use a param mapping to copy the value across.

We could change the type to String (to make it easier to set the value in the process) but that could break existing processes.  I would recommend we change the types of those properties to String but for backwards compatibility do support it if an Integer is passed as well.

Comment 3 Maciej Swiderski 2014-04-01 12:24:48 UTC
fixed by allowing both Integer (or actually Number) and String values to be given for the parameters. In case of number is given it gets intValue out of it, if String (non empty) it will parseInt from it. Otherwise null is returned and default values apply.

jbpm
master:
https://github.com/droolsjbpm/jbpm/commit/4480d0fdc70a9cb0d28b5ac1594ee050d4eaacab

6.0.x:
https://github.com/droolsjbpm/jbpm/commit/69f401ae1fcd081cf82447a6e27516e0658522de

Comment 4 JBoss JIRA Server 2014-04-01 12:27:26 UTC
Maciej Swiderski <swiderski.maciej> updated the status of jira JBPM-4278 to Resolved

Comment 5 David van Balen 2014-04-02 12:48:43 UTC
hanks for the fix. If it hasn't been done already, I also think that, at least, the Url parameter should be added to the predefined input data parameters and assignments, since it is the one required parameter. The Content and ContentType parameters should at least be added to the documentation, and possibly also to the pre-defined parameters, since there is currently no way of knowing they are supported without downloading and looking at the code.

I would propose that maybe all required parameters for a task should appear as both data input parameters and assignments by default, while non-required parameters only appear as data input parameters, but not under assignments. This would help document the available parameters for each task, while encouraging users to set a value for required parameters.

Comment 6 Jiri Svitak 2014-04-03 09:20:49 UTC
Hi David,

please check this BZ (it requests Content and ContentType to be added):
https://bugzilla.redhat.com/show_bug.cgi?id=1083259
All other parameters were created by default (in my case with BPMS 6.0.1.CR2).

Hope that helps,
Jiri


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