Skip to content

[Implement] XmiReader such that it can read a flat list of XmiElements that cross reference eachother #77

@samatstariongroup

Description

@samatstariongroup

Prerequisites

  • I have written a descriptive issue title
  • I have verified that I am running the latest version of the uml4net
  • I have searched open and closed issues to ensure it has not already been reported

Description

The following snippet (sourced from paragraph 7.10 from the XMI spec) shows that a valid model can contain a flat list of XmiElements where als the "owned" or composite aggregation items can be references to other XML Elements in the doc:

<?xml version="1.0" encoding="utf-8"?>
<xmi:XMI xmlns:uml="http://www.omg.org/spec/UML/20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001">
    <uml:Operation xmi:id="idO1" xmi:type="uml:Operation" xmi:label="op1" xmi:uuid="DCE:1234">
        <ownedRule xmi:id="idC1" xmi:type="uml:Constraint" xmi:label="co1" xmi:uuid="DCE:abcd">
            <specification xmi:type="uml:OpaqueExpression">
                <body>First Constraint definition</body>
            </specification>
            <constrainedElement xmi:idref="idO1"/>
        </ownedRule>
        <ownedRule xmi:idref="idC2"/>
        <ownedRule xmi:idref="idC3"/>
    </uml:Operation>
    <uml:Constraint xmi:id="idC2" xmi:type="uml:Constraint" xmi:label="co2" xmi:uuid="DCE:efgh">
        <specification xmi:type="uml:OpaqueExpression">
            <body>Second Constraint definition</body>
        </specification>
        <constrainedElement xmi:idref="idO1"/>
    </uml:Constraint>
    <uml:Constraint xmi:id="idC3" xmi:type="uml:Constraint" xmi:label="co3" xmi:uuid="DCE:ijkl">
        <specification xmi:type="uml:OpaqueExpression">
            <body>Third Constraint definition</body>
        </specification>
    </uml:Constraint>
</xmi:XMI>
  • The XmiReader only supports reading Package, Model and Profile. The read method needs to be code generated such that all concrete classes can be read
  • The current readers do not support <constrainedElement xmi:idref="idO1"/> or <ownedRule href="doc2.xml#idC4"/> for contained elements (composite aggregation

Steps to Reproduce

try to read the snippet with the XmiReader and notice that the reader fails

System Configuration

  • uml4net version:
    • uml4net: 1.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions