Skip to main content



      Home
Home » Modeling » UML2 » Associations to EReferences in UML2 profile to .ecore/.genmodel
Associations to EReferences in UML2 profile to .ecore/.genmodel [message #1857705] Tue, 21 February 2023 16:51 Go to next message
Eclipse UserFriend
Hi, I have a question about the transformation from UML2 to Ecore/genmodel for a Papyrus profile. (I'm not sure if I should it post it here, or in the EMF forum or the Papyrus forum; apologies if it is more suitable for any of the other forums).

Basically I have a simple profile in which I define a (containment) association between two stereotypes (see screen-shot and attached project) called "Contraption" and "Gizmo", with the association going from "Contraption" to "Gizmo". However, when I generate the corresponding .genmodel and .ecore from the .uml file (using the standard "New -> Other... -> EMF Generator Model approach) there is no EReference in "Contraption" pointing to "Gizmo", (see screen shot and attached project).

My question is whether this is a bug or is it expected behaviour from the genmodel generator?

If it is expected that EReferences are not generated from Associations, what is the "proper" way to generate such references? Perhaps an annotation on the association? Or Perhaps create a property in the container object with the "EReference" stereotype? Or is there another way?

Thanks

PS: I'm using Papyrus 4.8 (2020-06) and the UML2 Extender SDK 5.5.1
Re: Associations to EReferences in UML2 profile to .ecore/.genmodel [message #1857709 is a reply to message #1857705] Wed, 22 February 2023 01:23 Go to previous messageGo to next message
Eclipse UserFriend
Hi

UML Associations have considerable flexibility and so considerable opportunity for confusion.

At first glance I could see nothing wrong so as is often a good practice I compare with something that works.

Your association has two association-owned ends. The normal idiom is for at least one of the ends to be class-owned so that it can be reified into an EClass.

Regards

Ed Willink
Re: Associations to EReferences in UML2 profile to .ecore/.genmodel [message #1857719 is a reply to message #1857709] Wed, 22 February 2023 10:31 Go to previous messageGo to next message
Eclipse UserFriend
https://bugs.eclipse.org/bugs/show_bug.cgi?id=581575 raised since IMHO your 'mistake' should have triggered some helpful diagnosis.
[SOLVED] Re: Associations to EReferences in UML2 profile to .ecore/.genmodel [message #1857720 is a reply to message #1857719] Wed, 22 February 2023 10:57 Go to previous message
Eclipse UserFriend
Ah! Indeed that's it. I set the owner of the "gizmos" end to be Classifier and it generated the expected .ecore.

And I agree that a warning to the user would be useful in this case.

Thanks
Previous Topic:emx file conforming both to UML profile and UML metamodel
Next Topic:Feature 'eAnnotations' not found.
Goto Forum:
  


Current Time: Sun Jul 20 13:04:53 EDT 2025

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

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

Back to the top