Potential BPMN-Spec conformance flaw: Link-Event-Definition target property is handled as an attribute
See original GitHub issueDescribe the Bug
The target
-property of a LinkEventDefinition
is described as an xsd:element
in the BPMN 2.0 Semantic-Schema. Therefore it should be a child node of the link event definition in a BPMN model.
In contrast bpmn-moddle
defines a link event definition to include a property target
which is marked as an attribute: Link-Event-Definition-Target property.
This results in serialized models violating the BPMN-Semantic-Schema mentioned above: The target
-property will be serialized in an attribute of the LinkEventDefinition
whereas the Schema requires it to be a child node.
Importing a valid model (including the target as a child node) results in the target property being removed from the link event definition entirely.
Steps to Reproduce
The described bug occurs in two “directions”:
Case A (Export/Serialization) - Setting the target property on a link event definition results in the value being set as attribute in a serialized model Case B (Import/Deserialization) - Importing a valid BPMN-model containing the target of a link event definition as a child node results in the property being removed
The bug can not be directly reproduced by the means of this repository, but rather using another library like bpmn-js
using bpmn-moddle
.
Github does not allow uploading XML or BPMN-files, therefore models have been uploaded in plaintext.
Case A:
If the target property of a link event definition is set programmatically an exported/serialized model will contain the target property as an attribute instead of a child node: see the attached file invalid-link-event-definitions.txt, Link-Event-Definition with ID ID14e6ec89-6434-4ef9-bdab-6784f8fee217
.
Case B:
The attached file valid-link-event-definitions.txt contains a valid model according to the BPMN-Spec. Importing it by using bpmn-js
(for example by using the bpmn-js demo) results in the target property being removed from the link event definition of the intermediate throw event. The demo also shows an import warning:
unparsable content <bpmn:target> detected line: 5 column: 8 nested error: unknown type <bpmn:Target>
Expected Behavior
In Case A, the serialized model should include the target property as a child node <bpmn:target>
.
In Case B, the model should be imported without any warning and without the target property being removed.
Attached files valid-link-event-definitions.txt invalid-link-event-definitions.txt
Issue Analytics
- State:
- Created 10 months ago
- Reactions:1
- Comments:6 (5 by maintainers)
Top GitHub Comments
We could, but the linked file is already a ball of mud ^^
@barmac We could also workaround it, as we often do (https://github.com/bpmn-io/bpmn-moddle/blob/master/tasks/transforms/transformBPMN.cjs#L47).