*** Description of problem: If user wants to define local process variable. there is only String as data type in given combo. Other data types need to be added manually. *** Version-Release number of selected component (if applicable): jbds-9.0.0.CR1_jbdsis-9.0.0.Alpha1 *** Steps to Reproduce: 1. Create new process 2. Try to define new local variable If you wants to use other type as String, you will have to add it manually by plus button next to 'Item Subject' combo *** Additional info: Notice, that also labels in this area are little bit strange: Property list for process xyz Property details Item Subject I would expect something like this: Local variable list for process xyz Local variable details Data Type
The same situation for local variables of subprocess. Even basic data types as String, Float, Object must be added manually and there are wrong labels as mentioned in #c0.
#c0. == https://bugzilla.redhat.com/show_bug.cgi?id=1263294#c0
Created attachment 1073920 [details] ilustrating project
Please try to run illustrating project attachment. There is error like: ForEach node 'Sub Process 1' [3] has no collection expression]] But if you check given variable (numbers). it is declared as java.util.ArrayList. I hope this helps you in solving this BZ Bob.
Jozef, the data type definition for the java.util.ArrayList type in the sample project looks like this: <bpmn2:itemDefinition id="ItemDefinition_1" isCollection="false" structureRef="java.util.ArrayList"/> here, "isCollection" is false, indicating that ArrayList is NOT a collection and I see now that there is no way to set this attribute in the jBPM flavor of the editor (the generic editor does allow you to set this attribute true/false). This is a problem... Unfortunately, BPMN2 and Java have different ideas about what a "collection" is: in Java, it has certain behavioral characteristics (i.e., it must implement the Collection interface) but BPMN2 is only a descriptive language and does not natively understand that Java Collections are indeed "collections". We have some options here: 1. I could inspect the structureRef if it is a Java type (note that this could also be an XSD type!) and check if it implements Collection, and set the "isCollection" attribute accordingly. For XSD types I would have to check minOccurs and maxOccurs to determine if it's a collection. 2. I can expose the "isCollection" as a checkbox in the UI and make the user responsible for figuring out if the referenced type is a collection. 3. do both 1 and 2 WDYT?
Actually, thinking about this some more... the "isCollection" indicates whether the item definition is to be handled by the Process engine as a collection, and the "structureRef" indicates the data type of each element in the collection. So, if we define this: <bpmn2:itemDefinition id="ItemDefinition_1" isCollection="true" structureRef="java.util.ArrayList"/> it represents a collection of java.util.ArrayList elements which, I think, is not what was intended. It's possible that the jBPM engine ignores the "isCollection" attribute and just inspects the Java type itself to see if it makes sense in the context it is being used (or just lets the Java VM throw a runtime exception if it can't be cast to Collection). Ouch, my brain hurts ;)
Bob, expression 'isCollection' is probably not so important in this case. I checked web bpmn2 designer and I found this. If I model MI Subprocess there, I obtain something like this: <bpmn2:subProcess id="_AC7F9A0D-F0E8-4544-B91D-0A6DCCCB07A4" drools:selectable="true" color:background-color="#fafad2" color:border-color="#000000" color:color="#000000" name=""> <bpmn2:incoming>_4A23768D-5BC6-4E5A-B223-EDE080485374</bpmn2:incoming> <bpmn2:outgoing>_75F058DD-E136-47EB-A08A-5322EA87B5F3</bpmn2:outgoing> <bpmn2:ioSpecification id="_tfqBcWD3EeWsad8FvJC0Cg"> <bpmn2:dataInput id="_AC7F9A0D-F0E8-4544-B91D-0A6DCCCB07A4_input" name="iColl"/> <bpmn2:inputSet id="_tfqBcmD3EeWsad8FvJC0Cg"> <bpmn2:dataInputRefs>_AC7F9A0D-F0E8-4544-B91D-0A6DCCCB07A4_input</bpmn2:dataInputRefs> </bpmn2:inputSet> </bpmn2:ioSpecification> <bpmn2:dataInputAssociation id="_tfqBc2D3EeWsad8FvJC0Cg"> <bpmn2:sourceRef>iColl</bpmn2:sourceRef> <bpmn2:targetRef>_AC7F9A0D-F0E8-4544-B91D-0A6DCCCB07A4_input</bpmn2:targetRef> </bpmn2:dataInputAssociation> <bpmn2:multiInstanceLoopCharacteristics id="_tfqBdGD3EeWsad8FvJC0Cg"> <bpmn2:loopDataInputRef>_AC7F9A0D-F0E8-4544-B91D-0A6DCCCB07A4_input</bpmn2:loopDataInputRef> <bpmn2:inputDataItem xsi:type="bpmn2:tDataInput" id="miDataInput" itemSubjectRef="_AC7F9A0D-F0E8-4544-B91D-0A6DCCCB07A4_multiInstanceItemType"/> </bpmn2:multiInstanceLoopCharacteristics> </bpmn2:subProcess> I tried to add manually ioSpecification and dataInputAssociation to bpmn2 generated by eclipse modeler and error message about missing collection expression disappeared. There occurred another problem, but it was probably something with generated id's and item definitions from web bpmn2 designer. @Bob please, can you have a look at this?
Hi Jozef, the problem you describe above has been reported in https://bugzilla.redhat.com/show_bug.cgi?id=1265413 as a separate issue. The problem reported is fixed in: Luna build 1.1.4.201510291907 Mars build 1.2.1.201510291906 The selection list now contains all of the native Java data types.
Hi Bob. Fix looks good. I will mark as verified when fix will be mirrored in JBDS integration stack.
Verified on jbds-9.1.0.Beta2_jbdsis-9.0.0.Beta1 BPMN2 Modeler - 1.2.3.CR2-v20160209-2002