You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For my use case i want that a derived features shall be serialized. So far, independant of the transient flag, it is never serialized. For my point of view only transient shall determine if the feature is serialized or not.
Therefore I change the following lines in xmi.py
for feat in obj._isset:
if feat.derived or feat.transient:
to
for feat in eclass.eAllStructuralFeatures():
if feat.transient or not feat.derived and feat not in obj._isset:
What do you think about this topic?
The text was updated successfully, but these errors were encountered:
Thanks for your message! Sorry for the dealy, I had to go again in EMF documentation and implementation to check all of that as you made me doubt.
You were right, by default, all non-transient features are serialized, derived or not. My mistake came from the fact that most of the time, derived attributes are also set as transient. I will change that in the XMI serializer with something probably like this:
forfeatinobj._isset:
iffeat.transient:
...
I need to write tests to test this feature however :). I'm sorry, I have less time than usual lately to work on PyEcore, so it takes me time to include fixes.
No problem, I am happy if I can help to improve the library. The library really works great and I have learned a lot about python's internal functions by analysing your code.
Short remark on your solution: Removing the derivedwill be not sufficient, because it is not certain that the derived feature already exists in obj._isset. Therefore I do an iteration over all features.
For my use case i want that a derived features shall be serialized. So far, independant of the transient flag, it is never serialized. For my point of view only transient shall determine if the feature is serialized or not.
Therefore I change the following lines in xmi.py
to
What do you think about this topic?
The text was updated successfully, but these errors were encountered: