Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Derived unions and subsetted properties in UML to Ecore converter
Derived unions and subsetted properties in UML to Ecore converter [message #1770458] Fri, 11 August 2017 19:53 Go to next message
Ernesto Posse is currently offline Ernesto PosseFriend
Messages: 334
Registered: March 2011
Senior Member
Hi.

I am trying to convert a UML model (attached) to Ecore but I'm running into unexpected trouble.

The model is a simple representation of key-value maps, so it has, abstract classes Map, Field, Key and Value, each of which is specialized by ConcreteMap, ConcreteField, ConcreteKey and ConcreteValue, and it has the expected associations. For example there is a composition association from Map to Field. I want ConcreteMap's fields to be ConcreteFields so there is an association from ConcreteMap to ConcreteField where the "field" end of the Map-Field association is declared as derived, derived union and read-only, while the 'concretefield' end of the ConcreteMap-ConcreteField association is declared as subsetting the "field" property. The same is done with the keys and values.

The problem is that when I try to make the genmodel from this UML with the New->EMF Generator Model wizard, I get a bunch of warnings (see attached screenshot), stating for example that

Quote:
Feature 'maps::Map::field' should be annotated as a union and made non-changeable


and

Quote:
Feature 'maps::ConcreteMap::concretefield' should be annotated as subset of feature 'maps::Maps::filed


But the model has those very attributes set! See the attached model.

When I see the generated ecore, I see that for example, Map::field is derived, and non-changeable, so it seems that the transformation was correct.

The question is: why do I get those warnings? Is this a case of incorrect error reporting?

Thanks
[SOLVED] Re: Derived unions and subsetted properties in UML to Ecore converter [message #1770661 is a reply to message #1770458] Tue, 15 August 2017 20:13 Go to previous message
Ernesto Posse is currently offline Ernesto PosseFriend
Messages: 334
Registered: March 2011
Senior Member
On a closer look, the issue seems to be that in the import wizard I had the "Subsetting Properties" and "Union Properties" options set to "Report" rather than "Process". If I set them to "Process", the warnings go away and it looks like the generated code supports them.

Previous Topic:EObject does not send Notification.SET
Next Topic:Special character in String
Goto Forum:
  


Current Time: Thu Jun 21 10:50:15 GMT 2018

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

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

Back to the top