-
|
Hi, The Model to reproduce is quite basic:
where AgeRange is a EDataType based on integer with minInclusive and maxInclusive values set to 1-99. Based on EMF generated Editor, we can create Person model instances. If you enter the PropertySheetPage cell editor for age attribute, an hint is displayed in the status line reporting age has to be between 1-99: perfect so far. But if you don't edit this age attribute and only fill name value, right clicking to valide the person object, the validation is OK as successfully valid against the model which is not correct since age is undefined and valued with a default value set to 0. I did a try through java code to use Diagnostician.INSTANCE with the same result. In fact, EObjectValidator implementation (involved in Diagnostician::validate chain) checks data conformity with a method named EObjectValidator ::validate_DataValueConforms that first checks if the attribute (feature) is set. Is it the expected behavior in such situation ? The only way I've found to workaround this problem, is to go to generated code to modify the generated eIsSet() method to return systematically true for age attribute. But in my context, the generated code is not in GIT, it is produced during pipeline build. Does anyone have experience this problem ? Regards, Stéphane |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
|
You haven't mentioned it, but I assume that the Lower Bound property of the age attribute is 0 (the default) so you've declared age to be valid for the case that the age is not set at all. Change Lower Bound to 1 and then the age must be set so this will kick in when it's not set: You probably need to make age unsettable as well given it's primitive. And then, once it's been set, the validation of the value relative to the data type will kick in: |
Beta Was this translation helpful? Give feedback.



Not so easy when your model is about 100++ Class with many attributes referring to primiti…