Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Edapt] Unexpected behavior by defaultValueLiteral change
[Edapt] Unexpected behavior by defaultValueLiteral change [message #1798230] Wed, 14 November 2018 14:19 Go to next message
Michael Berger is currently offline Michael BergerFriend
Messages: 1
Registered: November 2018
Junior Member
Hello Community,

I have a question about the migration behavior of edapt in case of changed defaultValueLiteral. Maybe, it's a bug.

I have create a model with an enumeration and an element with an attribute from type of this enumeration. Additionally, the defaultValueLiteral is set to a literal of this enumeration.
After edapt release, the enumeration was extended by a new literal. This new literal was set to the new defaultValueLiteral in the element as before.

Now, here comes the problems in case of save options with XMLResource.OPTION_KEEP_DEFAULT_CONTENT = false. That means, a model instance with an element with attribute=default will not serialized the attribute.

A model instance from old release with old default will serialize no attribute, same as a model instance from new release with new default. But, the edapt migration will set the newest default value for both instances, old and new model.

It seems, that the migrator takes the newest default value defined, independently of the history.

I have not found any other problems of the same issue, maybe someone can explain the behavior or tell me, its a bug :)

Best regards,
Michael
Re: [Edapt] Unexpected behavior by defaultValueLiteral change [message #1798443 is a reply to message #1798230] Mon, 19 November 2018 09:20 Go to previous message
Johannes Faltermeier is currently offline Johannes FaltermeierFriend
Messages: 101
Registered: December 2013
Senior Member

Hi Michael,

as far as I know there is no operation for changing the default value literal. So in the history there is just a metamodel change recorded.
For the migration this means that also only the Metamodel is changed and not the Model under migration. So this is not a bug but a missing feature.

In order to fix your problem, you may attach a Custom Migration to this default-value-change in the history.
Also contributions are welcome, if you want to contribute a change default value literal operation.

Kind regards,
Johannes


Johannes Faltermeier

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Previous Topic:[Facet] Support additional query language
Next Topic:Use of ecore2xml mappings
Goto Forum:
  


Current Time: Thu Apr 25 11:05:35 GMT 2024

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

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

Back to the top