Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Using user-defined model library creates dangling reference?
Using user-defined model library creates dangling reference? [message #1747001] Tue, 08 November 2016 13:21 Go to next message
Vetle Volden-Freberg is currently offline Vetle Volden-FrebergFriend
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 Go to previous messageGo to next message
Christian Damus is currently offline Christian DamusFriend
Messages: 1270
Registered: July 2009
Location: Canada
Senior Member

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 #1747008 is a reply to message #1747002] Tue, 08 November 2016 14:42 Go to previous messageGo to next message
Vetle Volden-Freberg is currently offline Vetle Volden-FrebergFriend
Messages: 39
Registered: February 2016
Member
Thank you for your answer Christian. That the ecore for my profile will require the ecore of the library makes sense.

I have managed to generate the ecore from the library model, but how do I register it as a dynamic Ecore model in my profile?


Regards, Vetle VF.
Re: Using user-defined model library creates dangling reference? [message #1747018 is a reply to message #1747008] Tue, 08 November 2016 15:21 Go to previous message
Christian Damus is currently offline Christian DamusFriend
Messages: 1270
Registered: July 2009
Location: Canada
Senior Member

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
Previous Topic:enhancement request - NamedElement names shall be configurable
Next Topic:Programmatically create a diagram of custom diagram kind
Goto Forum:
  


Current Time: Tue Apr 23 12:21:08 GMT 2024

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

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

Back to the top