Serialization problems when exporting diagram to XML

When exporting a diagram to XML the serialization of [multiInstanceLoopCharacteristics] is not in conformance to the schema definition:

  1. [loopDataInputRef] and [loopDataOutputRef] are serialized as attributes and not as elements
  2. [inputDataItem] and [outputDataItem] are serialized as [dataInput] and [dataOutput]

Schema definition:

<xsd:element name="multiInstanceLoopCharacteristics" type="tMultiInstanceLoopCharacteristics"  substitutionGroup="loopCharacteristics"/>
<xsd:complexType name="tMultiInstanceLoopCharacteristics">
	<xsd:complexContent>
		<xsd:extension base="tLoopCharacteristics">
			<xsd:sequence>
				<xsd:element name="loopCardinality" type="tExpression" minOccurs="0" maxOccurs="1"/>
				<xsd:element name="loopDataInputRef" type="xsd:QName" minOccurs="0" maxOccurs="1"/>
				<xsd:element name="loopDataOutputRef" type="xsd:QName" minOccurs="0" maxOccurs="1"/>
				<xsd:element name="inputDataItem" type="tDataInput" minOccurs="0" maxOccurs="1"/>
				<xsd:element name="outputDataItem" type="tDataOutput" minOccurs="0" maxOccurs="1"/>
				<xsd:element ref="complexBehaviorDefinition" minOccurs="0" maxOccurs="unbounded"/>
				<xsd:element name="completionCondition" type="tExpression" minOccurs="0" maxOccurs="1"/>
			</xsd:sequence>
			<xsd:attribute name="isSequential" type="xsd:boolean" default="false"/>
			<xsd:attribute name="behavior" type="tMultiInstanceFlowCondition" default="All"/>
			<xsd:attribute name="oneBehaviorEventRef" type="xsd:QName" use="optional"/>
			<xsd:attribute name="noneBehaviorEventRef" type="xsd:QName" use="optional"/>
		</xsd:extension>
	</xsd:complexContent>
</xsd:complexType>

Source XML:

<bpmn:multiInstanceLoopCharacteristics id="g9sdgh0sd" isSequential="false">
    <bpmn:loopDataInputRef>CheckDataTaskInput</bpmn:loopDataInputRef>
    <bpmn:loopDataOutputRef>CheckDataTaskOutput</bpmn:loopDataOutputRef>
    <bpmn:inputDataItem id="LoopInstanceInput" isCollection="false" itemSubjectRef="TravelOrderItem" name="CheckDataTask.TravelOrder"/>
    <bpmn:outputDataItem id="LoopInstanceOutput" isCollection="false" itemSubjectRef="TravelOrderItem" name="CheckDataTask.TravelOrder"/>
</bpmn:multiInstanceLoopCharacteristics>

Exported XML:

  <bpmn:multiInstanceLoopCharacteristics id="g9sdgh0sd" loopDataInputRef="CheckDataTaskInput" loopDataOutputRef="CheckDataTaskOutput">
    <bpmn:dataInput id="LoopInstanceInput" itemSubjectRef="TravelOrderItem" name="CheckDataTask.TravelOrder" />
    <bpmn:dataOutput id="LoopInstanceOutput" itemSubjectRef="TravelOrderItem" name="CheckDataTask.TravelOrder" />
  </bpmn:multiInstanceLoopCharacteristics>

Thanks for the report. I added a bug ticket for it.

Could you provide us with a valid BPMN 2.0 file that reproduces this behavior?

Here is an example file that should reproduce the problem:
example.bpmn (10.4 KB)

Can I use the example as part of our test suite?

Yes, feel free to use it in your tests.

Fixed with latest bpmn-moddle release.

1 Like