Community
Participate
Working Groups
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.
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 :(
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