Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Accessing parent
Accessing parent [message #990083] Mon, 10 December 2012 19:31 Go to next message
Matthias Schoettle is currently offline Matthias SchoettleFriend
Messages: 21
Registered: July 2009
Junior Member
Hi everyone,

previously (OCL Examples and Editors 3.1.x in Indigo) it was possible to access the container/parent of an element (or maybe it is considered non-navigable opposite) like this (assuming that X contains Y and the context is Y): self.X

In the current version this doesn't work anymore. What is the alternative (or best way) to achieve this?

Thanks,
Matthias
Re: Accessing parent [message #990087 is a reply to message #990083] Mon, 10 December 2012 20:03 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

self.X should work. Do you mean Juno SR1 by the current version?

self.oclContainer().oclAsType(X) may also work.

Regards

Ed Willink

On 10/12/2012 19:31, Matthias Schoettle wrote:
> Hi everyone,
>
> previously (OCL Examples and Editors 3.1.x in Indigo) it was possible
> to access the container/parent of an element (or maybe it is
> considered non-navigable opposite) like this (assuming that X contains
> Y and the context is Y): self.X
>
> In the current version this doesn't work anymore. What is the
> alternative (or best way) to achieve this?
>
> Thanks,
> Matthias
Re: Accessing parent [message #990089 is a reply to message #990087] Mon, 10 December 2012 20:22 Go to previous messageGo to next message
Matthias Schoettle is currently offline Matthias SchoettleFriend
Messages: 21
Registered: July 2009
Junior Member
Hi Ed,

yes, I mean Juno SR1.

It seems that the error message that I get doesn't affect saving the ecore file (other errors don't allow to save) and the constraint (in this case) still gets evaluated. So it still works, despite the error message being shown in the editor:

The feature 'element' of 'org.eclipse.ocl.examples.xtext.base.baseCST.impl.PathElementCSImpl@1c7c571e{platform:/resource/MyProject/model/My.ecore#//@ownedNestedPackage.0/@ownedType.2/@ownedConstraint.2/@specification/@ownedExpression/@ownedExpression.1/@pathName/@path.0}' contains a dangling reference 'org.eclipse.ocl.examples.pivot.internal.impl.PropertyImpl@368c9326{#//}'


- Matthias

[Updated on: Mon, 10 December 2012 20:33]

Report message to a moderator

Re: Accessing parent [message #990208 is a reply to message #990089] Tue, 11 December 2012 12:09 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

The JUnit test for unnavigable containment navigation seems to be
unchanged since March 2011 so I'm unclear why you observe a change.

I've added a more intensive testing of alternative containment spellings
and they all works fine in my working branch.

"dangling reference" can come from other causes; most likely the failure
in the synthesized type reification prior to save.

Can you post a simplified zipped project demonstrating the problem? In
particular what are the types of self, C and their relationship?

Regards

Ed Willink

On 10/12/2012 20:22, Matthias Schoettle wrote:
> Hi Ed,
>
> yes, I mean Juno SR1.
>
> self.X doesn't work for me anymore, unfortunately. This is the error
> message: The feature 'element' of
> 'org.eclipse.ocl.examples.xtext.base.baseCST.impl.PathElementCSImpl@1c7c571e{platform:/resource/MyProject/model/My.ecore#//@ownedNestedPackage.0/@ownedType.2/@ownedConstraint.2/@specification/@ownedExpression/@ownedExpression.1/@pathName/@path.0}'
> contains a dangling reference
> 'org.eclipse.ocl.examples.pivot.internal.impl.PropertyImpl@368c9326{#//}'
>
> - Matthias
Re: Accessing parent [message #1005327 is a reply to message #990208] Thu, 24 January 2013 21:54 Go to previous messageGo to next message
Matthias Schoettle is currently offline Matthias SchoettleFriend
Messages: 21
Registered: July 2009
Junior Member
Hi,

sorry for the late response.

I unfortunately cannot reproduce this error with a new model (i.e., a simplified version). It randomly appears in my file. With a new model it didn't happen.

I found two other problems though that worked before. You can find an example attached.

Regards,
Matthias
  • Attachment: ocltest.zip
    (Size: 1.67KB, Downloaded 229 times)
Re: Accessing parent [message #1005382 is a reply to message #1005327] Fri, 25 January 2013 08:12 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

And the problems that you see are??

This newsgroup/forum is searchable so that similar problems and
solutions can be shared. If you don't identify your problems you deny
others the opportunity to share. This is totally contrary to the ethos
of Open Source and Eclipse; and also a waste of my time.

I see only one problem with the attached; you have stored OCLinEcore
concrete syntax as a *.ecore file, so opening the file with any EMF tool
bombs. Use *.oclinecore for OCLinEcore concrete syntax.

Regards

Ed Willink


On 24/01/2013 21:54, Matthias Schoettle wrote:
> Hi,
>
> sorry for the late response.
>
> I unfortunately cannot reproduce this error with a new model (i.e., a simplified version). It randomly appears in my file. With a new model it didn't happen.
>
> I found two other problems though that worked before. You can find an example attached.
>
> Regards,
> Matthias
Previous Topic:CompleteOCL parser problem
Next Topic:CompleteOCL parser problem
Goto Forum:
  


Current Time: Thu Mar 28 16:43:22 GMT 2024

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

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

Back to the top