Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Multiple Inheritance in UML Profile
Multiple Inheritance in UML Profile [message #1753981] Mon, 13 February 2017 16:21 Go to next message
Ran Wei is currently offline Ran WeiFriend
Messages: 111
Registered: September 2012
Location: York, UK
Senior Member
Hi there,

We currently have a problem related to modeling multiple inheritance using Papyrus creating an UML profile.

As shown in screenshot provided, we created three Stereotypes S1, S2 and S3 (base class UML::Class). When we want to create a UML model and try to apply S2 to a Class, nothing happens.

Please advise, minimal example provided.

Cheers,
Will


Research Associate
Department of Computer Science
University of York
Re: Multiple Inheritance in UML Profile [message #1753990 is a reply to message #1753981] Mon, 13 February 2017 16:54 Go to previous messageGo to next message
Patrick Tessier is currently offline Patrick TessierFriend
Messages: 238
Registered: July 2009
Location: Paris Saclay, France
Senior Member
In fact, you have fin a a bug: may be due to ecore

when you create a stereotype a property named base_<metaclass> is created in the stereotype.

In your case S3 inherits form S1 and S2. So by inheritance it references 2 properties named base_class.

In order to run you profile we must delegate to EMF ecore a profile definition ( a generation of a ecore model) But ecore does not like that S3 reference 2 references with the same name. So it named the Eref as S2_base_class. and this is the problem.
Rename this ereference and it runs

Could you add this problem in the papyrus bugzilla, please.


Could you add this problem with ecore it in the bugzilla please.
<?xml version="1.0" encoding="UTF-8"?>
<uml:Profile xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_PSN_8PH_Eeavesbv6PLofw" name="RootElement" metaclassReference="_Z0CY4PH_Eeavesbv6PLofw">
  <eAnnotations xmi:id="_brWf0fH_Eeavesbv6PLofw" source="http://www.eclipse.org/uml2/2.0.0/UML">
    <contents xmi:type="ecore:EPackage" xmi:id="_9LSZUPIKEeabIfKVa3jbNw" name="RootElement" nsURI="http:///schemas/RootElement/_9LIoUPIKEeabIfKVa3jbNw/1" nsPrefix="RootElement">
      <eAnnotations xmi:id="_9LWDsPIKEeabIfKVa3jbNw" source="PapyrusVersion">
        <details xmi:id="_9LWDsfIKEeabIfKVa3jbNw" key="Version" value="0.0.2"/>
        <details xmi:id="_9LWDsvIKEeabIfKVa3jbNw" key="Comment" value=""/>
        <details xmi:id="_9LWDs_IKEeabIfKVa3jbNw" key="Copyright" value=""/>
        <details xmi:id="_9LWDtPIKEeabIfKVa3jbNw" key="Date" value="2017-02-13"/>
        <details xmi:id="_9LWDtfIKEeabIfKVa3jbNw" key="Author" value=""/>
      </eAnnotations>
      <eClassifiers xmi:type="ecore:EClass" xmi:id="_9LSZUfIKEeabIfKVa3jbNw" name="S1">
        <eAnnotations xmi:id="_9LSZUvIKEeabIfKVa3jbNw" source="http://www.eclipse.org/uml2/2.0.0/UML" references="_XZQYgPH_Eeavesbv6PLofw"/>
        <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_9LSZU_IKEeabIfKVa3jbNw" name="base_Class" ordered="false" lowerBound="1">
          <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Class"/>
        </eStructuralFeatures>
      </eClassifiers>
      <eClassifiers xmi:type="ecore:EClass" xmi:id="_9LSZVfIKEeabIfKVa3jbNw" name="S2">
        <eAnnotations xmi:id="_9LSZVvIKEeabIfKVa3jbNw" source="http://www.eclipse.org/uml2/2.0.0/UML" references="_X5TxkPH_Eeavesbv6PLofw"/>
        <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_9LSZV_IKEeabIfKVa3jbNw" name="base_Class" ordered="false" lowerBound="1">
          <eAnnotations xmi:id="_9LSZWPIKEeabIfKVa3jbNw" source="redefines" references="_9LSZU_IKEeabIfKVa3jbNw"/>
          <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Class"/>
        </eStructuralFeatures>
      </eClassifiers>
      <eClassifiers xmi:type="ecore:EClass" xmi:id="_9LSZWvIKEeabIfKVa3jbNw" name="S3" eSuperTypes="_9LSZUfIKEeabIfKVa3jbNw _9LSZVfIKEeabIfKVa3jbNw">
        <eAnnotations xmi:id="_9LSZW_IKEeabIfKVa3jbNw" source="http://www.eclipse.org/uml2/2.0.0/UML" references="_YVW0YPH_Eeavesbv6PLofw"/>
      </eClassifiers>
    </contents>
  </eAnnotations>
  <elementImport xmi:id="_Z0CY4PH_Eeavesbv6PLofw" alias="Class">
    <importedElement xmi:type="uml:Class" href="pathmap://UML_METAMODELS/UML.metamodel.uml#Class"/>
  </elementImport>
  <packagedElement xmi:type="uml:Stereotype" xmi:id="_XZQYgPH_Eeavesbv6PLofw" name="S1">
    <ownedAttribute xmi:id="_apv44fH_Eeavesbv6PLofw" name="base_Class" association="_apvR0PH_Eeavesbv6PLofw">
      <type xmi:type="uml:Class" href="pathmap://UML_METAMODELS/UML.metamodel.uml#Class"/>
    </ownedAttribute>
  </packagedElement>
  <packagedElement xmi:type="uml:Stereotype" xmi:id="_X5TxkPH_Eeavesbv6PLofw" name="S2">
    <ownedAttribute xmi:id="_aQY9sfH_Eeavesbv6PLofw" name="base_Class" association="_aQYWoPH_Eeavesbv6PLofw">
      <type xmi:type="uml:Class" href="pathmap://UML_METAMODELS/UML.metamodel.uml#Class"/>
    </ownedAttribute>
  </packagedElement>
  <packagedElement xmi:type="uml:Stereotype" xmi:id="_YVW0YPH_Eeavesbv6PLofw" name="S3">
    <generalization xmi:id="_bAp9APH_Eeavesbv6PLofw" general="_XZQYgPH_Eeavesbv6PLofw"/>
    <generalization xmi:id="_bU4gkPH_Eeavesbv6PLofw" general="_X5TxkPH_Eeavesbv6PLofw"/>
  </packagedElement>
  <packagedElement xmi:type="uml:Extension" xmi:id="_aQYWoPH_Eeavesbv6PLofw" name="E_S2_Class1" memberEnd="_aQY9sPH_Eeavesbv6PLofw _aQY9sfH_Eeavesbv6PLofw">
    <ownedEnd xmi:type="uml:ExtensionEnd" xmi:id="_aQY9sPH_Eeavesbv6PLofw" name="extension_S2" type="_X5TxkPH_Eeavesbv6PLofw" aggregation="composite" association="_aQYWoPH_Eeavesbv6PLofw"/>
  </packagedElement>
  <packagedElement xmi:type="uml:Extension" xmi:id="_apvR0PH_Eeavesbv6PLofw" name="E_S1_Class1" memberEnd="_apv44PH_Eeavesbv6PLofw _apv44fH_Eeavesbv6PLofw">
    <ownedEnd xmi:type="uml:ExtensionEnd" xmi:id="_apv44PH_Eeavesbv6PLofw" name="extension_S1" type="_XZQYgPH_Eeavesbv6PLofw" aggregation="composite" association="_apvR0PH_Eeavesbv6PLofw"/>
  </packagedElement>
</uml:Profile>


Re: Multiple Inheritance in UML Profile [message #1754079 is a reply to message #1753990] Tue, 14 February 2017 12:15 Go to previous message
Ran Wei is currently offline Ran WeiFriend
Messages: 111
Registered: September 2012
Location: York, UK
Senior Member
Thanks! I have created a bug report.

P.S. Do we get chocolate for discovering bugs?


Research Associate
Department of Computer Science
University of York
Previous Topic:compile Papyrus source code
Next Topic:Code generation problems reporting (display error / waring on model elements and in problems view)
Goto Forum:
  


Current Time: Tue Jan 28 16:18:02 GMT 2020

Powered by FUDForum. Page generated in 0.02112 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top