|
Re: OCL, AnyType and FeatureMaps [message #479097 is a reply to message #479054] |
Sun, 09 August 2009 06:19 |
Ed Willink Messages: 7655 Registered: July 2009 |
Senior Member |
|
|
Hi Derek
I'm pretty sure that there is no support for FeatureMaps, but it is
possible that there is an extension that I'm not aware of.
I don't think that there is any easy backdoor approach, since
EFeatureMap is an EDataType rather than an EClass, so there are no
operations visible to OCL.
Explicit support for FeatureMaps in OCL is unlikely any time soon since
there is no counterpart in EMOF.
I think that your best approach is to develop an EcoreHelper class that
provides maybe a getFeatureMapEntryKey(EFeatureMap, String) method that
can be invoked from OCL. Feel free to contribute the result.
Regards
Ed Willink
Derek Palma wrote:
> Hi,
>
> I have been using OCL to query all EMF models in my system. I ran into
> an issue when I tried to query models with AnyTypeImpl. Its interface,
> AnyType, is defined in com.eclipse.emf.ecore.xml.type. AnyType contains
> some feature maps.
>
> public interface AnyType extends EObject {
>
> FeatureMap getMixed();
>
> ...
>
> My problem is that I cannot query the contents of the FeatureMap with
> OCL. Assuming self == the AnyType instance
>
> self.mixed.<something in FeatureMap> does not seem to work. For every
> feature name in the FeatureMap I give it it complains about an
> unrecognized variable. self.mixed returns the featureMap, however.
>
> Is query FeatureMaps supported as they are defined here? If yes, how
> should the OCL look?
>
> Thanks,
> Derek
|
|
|
Powered by
FUDForum. Page generated in 0.03622 seconds