if (flowElement instanceof Activity) {
ActivityImpl activity = (ActivityImpl) flowElement;
boolean isMulti = getPropertyValueAsBoolean(PROPERTY_MULTIINSTANCE, elementNode);
if(isMulti){
MultiInstanceLoopCharacteristics newLoopCharacteristics = Bpmn2Factory.eINSTANCE.createMultiInstanceLoopCharacteristics();
String inputDataCollection = getPropertyValueAsString(PROPERTY_MULTIINSTANCE_INPUT_COLLECTION, elementNode);
String inputDataItem = getPropertyValueAsString(PROPERTY_MULTIINSTANCE_INPUT_ITEM, elementNode);
String outputDataCollection = getPropertyValueAsString(PROPERTY_MULTIINSTANCE_OUTPUT_COLLECTION, elementNode);
String outputDataItem = getPropertyValueAsString(PROPERTY_MULTIINSTANCE_OUTPUT_ITEM, elementNode);
String completeExpression = getPropertyValueAsString(PROPERTY_MULTIINSTANCE_CONDITION, elementNode);
//输出变量
DataOutput dataOutput = Bpmn2Factory.eINSTANCE.createDataOutput();
Expression dataOutputExpression = FixFlowFactory.eINSTANCE.createExpression();
dataOutputExpression.setName(outputDataItem);
dataOutputExpression.setValue(outputDataItem);
BpmnModelUtil.addExtensionElement(dataOutput, FixFlowPackage.Literals.RESOURCE_FILTER__EXPRESSION, dataOutputExpression);
newLoopCharacteristics.setOutputDataItem(dataOutput);
//输入变量
DataInput dataInput = Bpmn2Factory.eINSTANCE.createDataInput();
Expression dataInputExpression = FixFlowFactory.eINSTANCE.createExpression();
dataInputExpression.setName(inputDataItem);
dataInputExpression.setValue(inputDataItem);
BpmnModelUtil.addExtensionElement(dataInput, FixFlowPackage.Literals.RESOURCE_FILTER__EXPRESSION, dataInputExpression);
newLoopCharacteristics.setInputDataItem(dataInput);
//输入数据集
LoopDataInputCollection loopDataInputCollection = FixFlowFactory.eINSTANCE.createLoopDataInputCollection();
Expression inputCollectionExpression = FixFlowFactory.eINSTANCE.createExpression();
inputCollectionExpression.setName(inputDataCollection);
inputCollectionExpression.setValue(inputDataCollection);
loopDataInputCollection.setExpression(inputCollectionExpression);
BpmnModelUtil.addExtensionElement(newLoopCharacteristics, FixFlowPackage.Literals.DOCUMENT_ROOT__LOOP_DATA_INPUT_COLLECTION, loopDataInputCollection);
//输出数据集
LoopDataOutputCollection loopDataOutputCollection = FixFlowFactory.eINSTANCE.createLoopDataOutputCollection();
Expression outputCollectionExpression = FixFlowFactory.eINSTANCE.createExpression();
outputCollectionExpression.setName(outputDataCollection);
outputCollectionExpression.setValue(outputDataCollection);
loopDataOutputCollection.setExpression(outputCollectionExpression);
BpmnModelUtil.addExtensionElement(newLoopCharacteristics, FixFlowPackage.Literals.DOCUMENT_ROOT__LOOP_DATA_OUTPUT_COLLECTION, loopDataOutputCollection);
//完成表达式
FormalExpression formalExpression= Bpmn2Factory.eINSTANCE.createFormalExpression();
formalExpression.setId(completeExpression);
formalExpression.setBody(completeExpression);
newLoopCharacteristics.setCompletionCondition(formalExpression);
activity.setLoopCharacteristics(newLoopCharacteristics);
}