Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 236184

Summary: UML2Ecore Converter should make derived features transient
Product: [Modeling] MDT.UML2 Reporter: Lutz Wrage <lw>
Component: CoreAssignee: Kenn Hussey <Kenn.Hussey>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Kenn.Hussey
Version: 2.2.0Keywords: plan
Target Milestone: M4Flags: Kenn.Hussey: juno+
Hardware: PC   
OS: Windows XP   
Whiteboard: Community Support

Description Lutz Wrage CLA 2008-06-07 19:18:59 EDT
I am developing a heavyweight extension to define a DSL. I run into a problem when converting my metamodel to ecore. I've set the option to process derived features. For these features, the converter then sets the ecore containment property to false, and the volatile property to true. 
This is in  UMLUtil.UML2EcoreConverter.processDerivedFeatures(). 
However, the diagnostic message is that the derived feature was made transient and volatile, which is what I would expect to happen. It seems there's a bug in the converter. It should make the feature transient and leave the containment property alone.

This is in UML2 2.2.0.v200805201126, which I got with ganymede RC2.
Comment 1 Kenn Hussey CLA 2008-06-09 08:51:28 EDT
The message is misleading and needs to be changed. The converter used to make all derived properties transient, but this behavior was changed some time ago (in a previous release) since it cannot always be assumed that derived properties are transient.
Comment 2 Lutz Wrage CLA 2008-06-09 10:05:07 EDT
I guess the way to make properties transient is to use the ecore profile. Then the diagnostic messages _UI_UML2EcoreConverter_ProcessDerivedFeature_diagnostic and _UI_UML2EcoreConverter_ReportDerivedFeature_diagnostic should be changed because they led me to believe that the code is wrong.
The question remains why the converter sets containment to false for derived features. Again, if this is the intended behavior, the diagnostic messages should reflect this.
Comment 3 Kenn Hussey CLA 2008-06-09 11:48:04 EDT
Yes, the messages will be changed during the next release.

It's generally not a good idea for derived features to be containment, because of some of the assumptions in EMF; for example, the copier and cross referencer both ignore derived features.
Comment 4 Lutz Wrage CLA 2008-06-09 12:08:00 EDT
However, in connection with feature maps, EMF needs derived containment features. This is what I am trying to do. My workaround is to set volatile and transient using the ecore profile and to turn off processing of derived features.
Comment 5 Kenn Hussey CLA 2008-06-09 13:04:59 EDT
Ah, I suppose we could change the logic to that feature map features aren't processed... in any case, that work around makes sense (and gives you greater control).
Comment 6 Kenn Hussey CLA 2011-07-19 18:04:21 EDT
Since it's more likely that derived properties are transient than not, we should probably change the behaviour so that this is the rule and use the Ecore profile to mark properties which should not be transient.
Comment 7 Kenn Hussey CLA 2011-08-22 23:34:05 EDT
The changes have been committed to git.