|Setting attribute with first literal of an enumeration [message #1776988]
||Thu, 23 November 2017 12:49
| Camilo Almendra
Registered: November 2017
I've noted a behavior of Sirius (Obeo Designer Community, Version 10.0.0) when trying to set an enumeration literal value to an attribute.
- There is a class "Relationship" that contains an enumeration literal as attribute, this enumeration has two literals:
<eClassifiers xsi:type="ecore:EClass" name="Relationship">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="type" eType="#//RelationshipType"/>
<eClassifiers xsi:type="ecore:EEnum" name="RelationshipType">
<eLiterals name="OneToOne" value="1"/>
<eLiterals name="OneToMany" value="2"/>
- Model operation: I've created two separated Edge (element-based) Creation tools, the main diference between them is the value set for "type" feature. Please see attached figurem that shows the "OneToMany" tool (the other tool is configured in similar fashion, just changing the literal value to OneToOne)
- The first enumeration literal never makes to the model. See below an excerpt of the xmi file after using the edge creation tools:
<relations source="//@entities.2" target="//@entities.1" type="OneToMany" name="R2"/> // using set type to OneToMany
<relations source="//@entities.3" target="//@entities.0" name="R3"/> // using set type to OneToOne
- I've made some exploration, added more literals to the enumeration, and I've got same behavior: if the value is set with FIRST enumerarion literal, it is not registered in the underline model.
Is this an expected behavior? We should assume the first literal as default value for an enumeration attribute? Also, we should assume that this value will not be registered in the model file?
Thank you in advance.
Powered by FUDForum
. Page generated in 0.01996 seconds