[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.modeling.m2m] [QVTO] How to handle optional attributes with primitive types?
|
- From: Mark Br?oerkens <broerkens@xxxxxx>
- Date: Mon, 14 Sep 2009 22:52:33 +0200
- Newsgroups: eclipse.modeling.m2m
- Organization: EclipseCorner
- User-agent: Thunderbird 2.0.0.17 (Macintosh/20080914)
Dear all,
I am using QVTO with a metamodel that contains optional (0..1
multiplicity) attributes which are of type EBoolean.
In order to be able to distinguish between 'true', 'false' (the default)
and '<not set>' the property 'unsettable' is set to 'true'.
In Java I can find out if the attribute is set by calling 'eIsSet()'.
In QVTO I tried the following expression to check if the value of an
optional attribute was set:
obj.myOptionalAttribute->notEmpty()
This worked fine for most attributes. Unfortunately, it doesn't work for
attributes of type EBoolean (or enumerations).
Did I find a bug in QVTO/OCL or is there another way for finding out if
an optional attribute is set in QVTO?
Thank you very much in advance.
Kind regards
Mark