[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.mdt.ocl] Re: OCL, AnyType and FeatureMaps

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