Bug 497798 - Constant assignment can not be used for service task input parameter
Summary: Constant assignment can not be used for service task input parameter
Status: NEW
Alias: None
Product: BPMN2Modeler
Classification: SOA
Component: Core (show other bugs)
Version: 1.2.3   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: future   Edit
Assignee: Robert Brodt CLA
QA Contact: Jozef Marko CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-13 03:49 EDT by Jozef Marko CLA
Modified: 2016-08-15 09:53 EDT (History)
0 users

See Also:
jomarko: mars+


Attachments
demo project (52.19 KB, application/zip)
2016-07-13 03:49 EDT, Jozef Marko CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jozef Marko CLA 2016-07-13 03:49:05 EDT
Created attachment 263071 [details]
demo project

Reproducible on:
jbds-9.1.0.GA_jbdsis-9.0.1.CR1
BPMN2 Modeler - 1.2.4.Final-v20160330-1625-B110


Description:
In the attached project is simple service task, that increases a number. I used as input parameter for this service task constant number 100. But when I try to run the main method in the ProcessMain class, I obtain exceptions about type mismatch. If I use declared variable "number" as input for the service task, the method main works without problem.
Comment 1 Robert Brodt CLA 2016-08-10 17:06:27 EDT
Hi Jozef,

Just looked at this and noticed that there is a Data Input named "ParameterType" - did you add that, or is this some new Service input parameter I need to worry about? Can you explain what it's used for?

I wonder if we need to provide the FormalExpression.evaluatesToTypeRef attribute? This is an ItemDefinition which defines the data type of the expression. Can you try changing line 55 of the increase.bpmn2 file to this:

          <bpmn2:from xsi:type="bpmn2:tFormalExpression" id="FormalExpression_6" evaluatesToTypeRef="ItemDefinition_78">100</bpmn2:from>

and see if the process will run? The "ItemDefinition_78" is an java.lang.Integer data type defined on line 5, so the expression should now be typed.

If this works, I'll have to add a type selection combo box to this "Expression" because I don't know (without compiling and executing the script) what the resulting data type could be. For instance, you could have a script like "Hello World"; which would make it a String type instead of Integer :(
Comment 2 Jozef Marko CLA 2016-08-15 09:53:16 EDT
Hi Bob,

I used the parameter 'ParameterType' as an effort to get the process working. I found this parameter in the ServiceTaskHandler [1]. I ONLY think, that it defines the data type for the operation parameter. Bout looking at the source code, I think it is not mandatory.

Next, I tried to replace the given line in source code but it didn't help. I am still obtaining the same exception.

Let me know in what other way I can help you.

[1]
https://github.com/droolsjbpm/jbpm/blob/master/jbpm-workitems/src/main/java/org/jbpm/process/workitem/bpmn2/ServiceTaskHandler.java#L228