我在Eclipse Luna中使用BPMN2建模器1.1.3.Final,目标是JBPM 6.2.0。
我试图在我的进程中使用多实例子进程,并遇到了子进程的循环实例参数的几个问题:
编辑器没有提供设置循环实例参数类型的方法,然后将缺少类型标记为错误。
编辑器似乎没有将循环实例参数视为子流程中的局部变量。
例如,请考虑以下过程:
<?xml version="1.0" encoding="UTF-8"?>
<!-- origin at X=0.0 Y=0.0 -->
<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:java="http://www.java.com/javaTypes" xmlns:tns="http://www.jboss.org/drools" xmlns="http://www.jboss.org/drools" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd http://www.jboss.org/drools drools.xsd http://www.bpsim.org/schemas/1.0 bpsim.xsd" id="Definition" exporter="org.eclipse.bpmn2.modeler.core" exporterVersion="1.1.3.Final" expressionLanguage="http://www.mvel.org/2.0" targetNamespace="http://www.jboss.org/drools" typeLanguage="http://www.java.com/javaTypes">
<bpmn2:itemDefinition id="ItemDefinition_2" isCollection="false" structureRef="java.util.List"/>
<bpmn2:process id="com.sample.bpmn" tns:packageName="defaultPackage" name="Sample Process" isExecutable="true" processType="Private">
<bpmn2:extensionElements>
<tns:import name="java.util.List"/>
</bpmn2:extensionElements>
<bpmn2:property id="items" itemSubjectRef="ItemDefinition_2" name="items"/>
<bpmn2:startEvent id="_1">
<bpmn2:outgoing>SequenceFlow_1</bpmn2:outgoing>
</bpmn2:startEvent>
<bpmn2:scriptTask id="ScriptTask_1" name="Script Task 1" scriptFormat="http://www.java.com/java">
<bpmn2:incoming>SequenceFlow_1</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_2</bpmn2:outgoing>
<bpmn2:script>kcontext.setVariable("items", new List<?>());
items.add("Hello");
items.add("World");</bpmn2:script>
</bpmn2:scriptTask>
<bpmn2:sequenceFlow id="SequenceFlow_1" tns:priority="1" sourceRef="_1" targetRef="ScriptTask_1"/>
<bpmn2:subProcess id="SubProcess_1" name="Sub Process 1">
<bpmn2:incoming>SequenceFlow_2</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_5</bpmn2:outgoing>
<bpmn2:multiInstanceLoopCharacteristics id="MultiInstanceLoopCharacteristics_2">
<bpmn2:loopDataInputRef>items</bpmn2:loopDataInputRef>
<bpmn2:inputDataItem xsi:type="bpmn2:tDataInput" id="item" name="item"/>
</bpmn2:multiInstanceLoopCharacteristics>
<bpmn2:startEvent id="StartEvent_1" name="Start Event 1">
<bpmn2:outgoing>SequenceFlow_3</bpmn2:outgoing>
</bpmn2:startEvent>
<bpmn2:callActivity id="CallActivity_1" tns:waitForCompletion="true" tns:independent="false" name="Call Activity 1" calledElement="B">
<bpmn2:incoming>SequenceFlow_3</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_4</bpmn2:outgoing>
</bpmn2:callActivity>
<bpmn2:sequenceFlow id="SequenceFlow_3" tns:priority="1" sourceRef="StartEvent_1" targetRef="CallActivity_1"/>
<bpmn2:endEvent id="EndEvent_1" name="End Event 1">
<bpmn2:incoming>SequenceFlow_4</bpmn2:incoming>
</bpmn2:endEvent>
<bpmn2:sequenceFlow id="SequenceFlow_4" tns:priority="1" sourceRef="CallActivity_1" targetRef="EndEvent_1"/>
</bpmn2:subProcess>
<bpmn2:sequenceFlow id="SequenceFlow_2" tns:priority="1" sourceRef="ScriptTask_1" targetRef="SubProcess_1"/>
<bpmn2:endEvent id="EndEvent_2" name="End Event 2">
<bpmn2:incoming>SequenceFlow_5</bpmn2:incoming>
</bpmn2:endEvent>
<bpmn2:sequenceFlow id="SequenceFlow_5" tns:priority="1" sourceRef="SubProcess_1" targetRef="EndEvent_2"/>
</bpmn2:process>
<!-- diagram block removed
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
</bpmndi:BPMNDiagram>
-->
</bpmn2:definitions>
该进程有一个名为items
的{{1}}类型的本地数据项,其中包含一些字符串。多实例子进程定义了一个名为List
的循环实例参数,该参数应该是item
类型。
对于问题1,BPMN2建模器为循环实例参数的名称提供了一个文本输入框。没有地方可以设置数据类型。但是,一旦我保存文件,我就会遇到一个&#34; JBPM流程问题&#34;说&#34;数据输入项目()没有数据类型&#34;。唯一的解决方法是在XML编辑器中打开文件,并将项目主题参考添加到String
定义:
inputDataItem
问题2是我真正关心的项目。在<bpmn2:inputDataItem xsi:type="bpmn2:tDataInput" id="item" name="item" itemSubjectRef="..."/>
,至少通过编辑器无法定义循环实例参数和子进程参数之间的数据映射。在尝试定义数据映射时,编辑器不会在源/目标数据项列表中包含循环实例参数。
这些只是编辑的缺点,还是我在这里做错了什么?