Closed Herbie60D closed 6 years ago
Hi,
Sorry, I am on holiday right now, will look after this issue as soon as I am back. However, this will only be 8th June.
Best,
Georg
Von: Herbie60Dmailto:notifications@github.com Gesendet: Montag, 14. Mai 2018 03:04 An: NMFCode/NMFmailto:NMF@noreply.github.com Cc: Subscribedmailto:subscribed@noreply.github.com Betreff: [NMFCode/NMF] enum values differ between model and serialization (#41)
Hello. When I use enumerations in my model and serialize it, NMF capitalizes the names of the enums instead of using the original names defined in the model.
Example: Model:
Code that uses the model:
TestElement testElement = new TestElement(); testElement.Enum = MetaModel.Model.Enum.Second;
Serialization by NMF:
The value of the attribute "enum" should be "second" as defined in the meta model, but instead it seems as if it gets the name of the generated C# enumeration element. Since the code generation creates a Class EnumConverter and two functions ConvertFrom and ConvertTo to map between the C# enumeration and the model values, I think this was not intended.
Because of this naming issue, when I try to read the serialization with EMF the enum value cannot be found, because of the wrong name.
Could you fix this issue?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/NMFCode/NMF/issues/41, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ACIV197Yk_7Dq9CFLYv82-jz0HsdiiIzks5tyVaOgaJpZM4T9gI1.
Thank you very much for your quick reply. Take your time and enjoy your vacation. For now, I have a workaround that I will later remove. You do a great job with NMF. Thanks for the good support.
Hello. I hope you had nice holidays. Do you had some time to look on this issue?
Sorry that this took so long, I had completely forgotten about it. It should be fixed now.
Thank you, I run my tests with the new version and the issue seems to be fixed now.
Hello. When I use enumerations in my model and serialize it, NMF capitalizes the names of the enums instead of using the original names defined in the model.
Example: Model:
Code that uses the model:
Serialization by NMF:
<model:TestElement xmi:version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" enum="Second" xmlns:xmi="http://www.omg.org/XMI" xmlns:model="http://example.com/model" />
The value of the attribute "enum" should be "second" as defined in the meta model, but instead it seems as if it gets the name of the generated C# enumeration element. Since the code generation creates a Class EnumConverter and two functions ConvertFrom and ConvertTo to map between the C# enumeration and the model values, I think this was not intended.
Because of this naming issue, when I try to read the serialization with EMF the enum value cannot be found, because of the wrong name.
Could you fix this issue?