[Edapt] Unexpected behavior by defaultValueLiteral change [message #1798230] |
Wed, 14 November 2018 14:19 |
Michael Berger 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 |
|
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/
|
|
|
Powered by
FUDForum. Page generated in 0.01883 seconds