Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Pivot oclContainer() result doesn't expose navigable properties
Pivot oclContainer() result doesn't expose navigable properties [message #931224] Wed, 03 October 2012 02:40 Go to next message
David Rees is currently offline David ReesFriend
Messages: 47
Registered: September 2012
Member
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 05:21 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
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 13:17 Go to previous message
David Rees is currently offline David ReesFriend
Messages: 47
Registered: September 2012
Member
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: Thu Apr 25 05:41:53 GMT 2024

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

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

Back to the top