bpmn-miwg / bpmn-miwg-test-suite

BPMN 2.0 Test Cases (Models, Diagrams, Serializations) created by the BPMN Model Interchange Working Group (BPMN MIWG) at the OMG
http://www.omgwiki.org/bpmn-miwg/
Other
100 stars 73 forks source link

Schema validation error on Testcase B.2.0 - Roundtrip (ARIS 10.0.14) #866

Closed ghost closed 1 year ago

ghost commented 3 years ago

Testcase B.2.0, Roundtrip, Tool SoftwareAG ARIS 10.0.14: Schema validation fails.

Schema validation error: Error Line 1802: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'deco:BPMNEnvelopeDecorator'.

SimonRinguette commented 3 years ago

From a first look, I believe that the usage of the Bound Envelope decorator is correct.

ghost commented 3 years ago

For more details see attached document SchemaValidationError.pdf

tstephen commented 3 years ago

I think you have actually highlighted a defect in the normative DI.xsd that invalidates the deco extension.

  1. I note the envelope deco example also fails to validate.
  2. The hint is in the comment in the envelope deco xsd at line 39. Note it says the BPMNEnvelopeDecorator should be wrapped in extensionElements rather than di:extension.
  3. However, the example would be invalid because BPMNEdge does not allow extensionElements which is part of the semantic model not the DI or BPMNDI models.
  4. Presumably, we just assumed that di:extension is the analogous wrapper in DI but there is a key difference: extensionElements includes <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" /> - note the processContents="lax". This is missing from the declaration of di:extension.
  5. The consequence is that di:extension has strict validation. I initially thought this meant that we just needed to provide an xsi:schemaLocation to direct the validator to a copy of the deco xsd but this made no difference. Maybe someone can spot a problem with this modified example including the schemaLocation? bpmn-envelope-decorator-bounds.bpmn.txt
  6. I verified this understanding in two ways; first by modifying the DI.xsd to include the BPMNEnvelopeDecorator. This validates fine but obviously we cannot just change that file, which is part of the spec. Similarly adding lax processing to DI extension also allows it to validate and that is the solution I believe we should go forward with (as and when there is an update taskforce!).

So to conclude, I believe it is impossible to extend BPMNEdge in the current spec.

falko commented 3 years ago

I can reproduce the schema validation issue with both files:

$ validbpmn bpmn-envelope-decorator-bounds.bpmn 
bpmn-envelope-decorator-bounds.bpmn:1627: element BPMNEnvelopeDecorator: Schemas validity error : Element '{http://www.omg.org/spec/BPMN/non-normative/extensions/envelope-decorator-bounds/1.0}BPMNEnvelopeDecorator': No matching global element declaration available, but demanded by the strict wildcard.
bpmn-envelope-decorator-bounds.bpmn fails to validate

$ validbpmn bpmn-envelope-decorator-bounds.bpmn.txt 
bpmn-envelope-decorator-bounds.bpmn.txt:1627: element BPMNEnvelopeDecorator: Schemas validity error : Element '{http://www.omg.org/spec/BPMN/non-normative/extensions/envelope-decorator-bounds/1.0}BPMNEnvelopeDecorator': No matching global element declaration available, but demanded by the strict wildcard.
bpmn-envelope-decorator-bounds.bpmn.txt fails to validate
SimonRinguette commented 2 years ago

This issue was discussed on the 2021-10-13 meeting. We all agree with @tstephen assessment.

This leaves us with either removing this extension or correcting it.

After I've re-checked the XSD:

<xsd:complexType abstract="true" name="DiagramElement">
<xsd:sequence>
<xsd:element name="extension" minOccurs="0">
<xsd:complexType>
<xsd:sequence>
<xsd:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:ID"/>
<xsd:anyAttribute namespace="##other" processContents="lax"/>
</xsd:complexType>

There is a potential workaround using the anyAttribute

<xsd:anyAttribute namespace="##other" processContents="lax"/>

I believe that we could transform the example to:

<bpmndi:BPMNEdge bpmnElement="_09e7cb23-4a1b-4165-b93a-cf635c223ee5" messageVisibleKind="initiating" id="E1373638081031__09e7cb23-4a1b-4165-b93a-cf635c223ee5" deco:height="12" deco:width="17" deco:x="209" deco:y="336.0">
    <di:waypoint x="305.0" y="188.0"/>
    <di:waypoint x="305.0" y="342.0"/>
    <di:waypoint x="130.0" y="342.0"/>
    <di:waypoint x="131.0" y="651.0"/>
    <bpmndi:BPMNLabel labelStyle="LS1373638080849">
        <dc:Bounds height="12.804751171875008" width="94.93333333333335" x="167.10533963254568" y="359.56612835107035"/>
    </bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>

Changing to using any attributes instead of an element:

        <bpmndi:BPMNEdge bpmnElement="_09e7cb23-4a1b-4165-b93a-cf635c223ee5" messageVisibleKind="initiating" id="E1373638081031__09e7cb23-4a1b-4165-b93a-cf635c223ee5" deco:height="12" deco:width="17" deco:x="209" deco:y="336.0">

This is the same approach that was taken for the BPMN in color extension.

Thoughts?

ghost commented 2 years ago

With ARIS 10.0.16 the Extension for Envelope Decorator Bounds is not supported anymore. Without this extension the schema validation is now successful.

dgagne commented 2 years ago

1 Jun 2022 Webmeeting o We confirmed that this is indeed an issue with our BPMN MIWG extension which was introduced based on a wrong assumption about DI o A new version of the BPMN MIWG extension will be created.

dgagne commented 1 year ago

5 Oct 2022 Webmeeting o We will apply the change to the schema as suggested by Simon on 13 Oct 2021 o We will then modify the B.2.0 example accordingly o Then do a round of vendor validation

falko commented 1 year ago

This is strange because there is an XML validation script for the extension's example: https://github.com/bpmn-miwg/bpmn-deco/blob/master/test-validation-of-example.sh Maybe that's broken. I'll investigate...

falko commented 1 year ago

Schema validation seems to work, if the extension schema is included in the validation:

$ xmllint  --schema 'bpmn/BPMN20.xsd' --noout bpmn-envelope-decorator-bounds.bpmn
bpmn-envelope-decorator-bounds.bpmn:1627: element BPMNEnvelopeDecorator: Schemas validity error : Element '{http://www.omg.org/spec/BPMN/non-normative/extensions/envelope-decorator-bounds/1.0}BPMNEnvelopeDecorator': No matching global element declaration available, but demanded by the strict wildcard.
bpmn-envelope-decorator-bounds.bpmn fails to validate
$ xmllint  --schema 'bpmn/BPMN20.xsd' --schema bpmn-envelope-decorator-bounds.xsd --noout bpmn-envelope-decorator-bounds.bpmn
bpmn-envelope-decorator-bounds.bpmn validates
SimonRinguette commented 1 year ago

I've made the PR for the envelope decorator bound: https://github.com/bpmn-miwg/bpmn-deco/pull/1

SimonRinguette commented 1 year ago

Closed by https://github.com/bpmn-miwg/bpmn-deco/pull/1