Skip to main content



      Home
Home » Modeling » OCL » Pivot oclContainer() result doesn't expose navigable properties
Pivot oclContainer() result doesn't expose navigable properties [message #931224] Tue, 02 October 2012 22:40 Go to next message
Eclipse UserFriend
I don't seem to be able to navigate associations on the result of oclContainer(). Am I missing a trick?

For example, from Library I can do "self.books", and from Book I can do "self.oclContainer()". But from Book if I do "self.oclContainer().books" I get the error "Unresolved Property 'OclElement::books".

This is on Eclipse 4.2.1 with org.eclipse.examples.pivot(3.2.1).

I've tried to do this on the Mature OCL as well, but I can't figure out what to use for container. I have tried eContainer(), container(), and oclContainer() to no avail.

Thanks,
dave
Re: Pivot oclContainer() result doesn't expose navigable properties [message #931338 is a reply to message #931224] Wed, 03 October 2012 01:21 Go to previous messageGo to next message
Eclipse UserFriend
Hi

OCL uses types just like many other languages.

The return type of oclContainer() is OclAny, so books is not applicable.

You need to use oclContainer().oclAsType(Library).books perhaps.

Regards

Ed Willink

On 03/10/2012 04:40, David Rees wrote:
> I don't seem to be able to navigate associations on the result of
> oclContainer(). Am I missing a trick?
>
> For example, from Library I can do "self.books", and from Book I can
> do "self.oclContainer()". But from Book if I do
> "self.oclContainer().books" I get the error "Unresolved Property
> 'OclElement::books".
>
> This is on Eclipse 4.2.1 with org.eclipse.examples.pivot(3.2.1).
>
> I've tried to do this on the Mature OCL as well, but I can't figure
> out what to use for container. I have tried eContainer(), container(),
> and oclContainer() to no avail.
>
> Thanks,
> dave
>
Re: Pivot oclContainer() result doesn't expose navigable properties [message #931725 is a reply to message #931338] Wed, 03 October 2012 09:17 Go to previous message
Eclipse UserFriend
Sorry, it never occurred to me that OCL would be typed. That's unusual in a query language I think. And I guess it doesn't come up that often (since normal property navigation knows the type) which I why I didn't see it any of the tutorials/examples I looked at. It seems I need to read actual language description a little closer. Sorry for obvious question, you are too precious a resource to waste on questions I answer from the specs Smile.

dave
Previous Topic:Extending operator semantics
Next Topic:[Announce] Eclipse OCL 4.1.0 (Kepler) M2 is now available
Goto Forum:
  


Current Time: Sun Apr 20 16:41:12 EDT 2025

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

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

Back to the top