Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » OCL, AnyType and FeatureMaps
OCL, AnyType and FeatureMaps [message #479054] Sat, 08 August 2009 16:09 Go to next message
Derek Palma is currently offline Derek PalmaFriend
Messages: 141
Registered: July 2009
Senior Member
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
Re: OCL, AnyType and FeatureMaps [message #479097 is a reply to message #479054] Sun, 09 August 2009 06:19 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 4150
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
Previous Topic:OCLExpressions
Next Topic:New to EMF and OCL
Goto Forum:
  


Current Time: Sat Nov 22 09:06:22 GMT 2014

Powered by FUDForum. Page generated in 0.02245 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software