Using user-defined model library creates dangling reference? [message #1747001] |
Tue, 08 November 2016 13:21 |
Vetle Volden-Freberg Messages: 39 Registered: February 2016 |
Member |
|
|
I am making a UML Profile that has a few stereotypes. In my stereotypes I am using some data types I have defined and which I have created a modelLibrary for in a separate UML model, let's say it's called exampleDataTypes.uml. This UML Model is using the Standard Profile and has the stereotype ModelLibrary applied to it.
I define several data types to my root element, say; Example Data Types.
I go to my UML profile, let's say example.profile. I import my modelLibrary using import -> import package from user model -> exampleDataTypes.uml.
Then I create a property in one of my stereotypes in my example.profile with one of the imported data types from my modelLibrary. I save and define my profile only to get the following error messages:
"the feature 'eType' of 'var : ExampleTypes_SomeType' contains a dangling reference ExampleTypes_SomeType''
"the feature 'eClassifier of 'ExampleTypes_SomeType' contains a dangling reference ExampleTypes_SomeType'
I have tried to import my modelLibrary also by creating a child node <Package import> and referencing the UML Model exampleDataTypes and get the same error.
Any thoughts?
Vetle VF.
[Updated on: Tue, 08 November 2016 13:25] Report message to a moderator
|
|
|
Re: Using user-defined model library creates dangling reference? [message #1747002 is a reply to message #1747001] |
Tue, 08 November 2016 13:33 |
|
Hi, Vetle,
In order to produce a complete Ecore definition of your profile, it is necessary for that Ecore definition to have a corresponding Ecore definition of your model library that it can reference. So far, you have only an UML definition of that library.
You can use the UML2 SDK's model importer to import your library into an EMF generator model and generate the Ecore definition and Java code for it. Or just use the UML editor to convert your library to Ecore and register it as a dynamic Ecore model.
The UML2 wiki pages should have some tutorials for generating Ecore and EMF artifacts from UML.
HTH,
Christian
|
|
|
|
Re: Using user-defined model library creates dangling reference? [message #1747018 is a reply to message #1747008] |
Tue, 08 November 2016 15:21 |
|
Hi, Vetle,
You need to register the package in the usual way on the appropriate EMF extension point:
- org.eclipse.emf.ecore.generated_package -- for generated Ecore packages (the EMF generator would usually generate this for you in the plugin.xml file)
- org.eclipse.emf.ecore.dynamic_package -- for dynamic packages (I think this is your case)
The UML2 SDK provides an extension point analogous to these EMF extension points: org.eclipse.uml2.uml.generated_package and org.eclipse.uml2.uml.dynamic_package, respectively. These provide the UML run-time with the association between the UML source and the Ecore representation. You can see examples in the org.eclipse.papyrus.infra.filters bundle (for a generated package) and the org.eclipse.uml2.uml.resources bundle (for dynamic packages).
HTH,
Christian
|
|
|
Powered by
FUDForum. Page generated in 0.02211 seconds