Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » [OCLinEcore] Specifying bidirectional associations (Bidirectional associations across package boundaries)
[OCLinEcore] Specifying bidirectional associations [message #549990] Wed, 28 July 2010 16:31 Go to next message
Missing name Mising name is currently offline Missing name Mising nameFriend
Messages: 6
Registered: July 2010
Junior Member
Hi!

I am currently working with the OCLinEcore-Editor (that is definitely great work!)
However, there are some problems when defining bidirectional associations.

To be more exact, the problem occurs when defining bidirectional associations across package boundaries. Knowing that cross-package bidirectional associations are in a sense critical, I would like to use them. Given that the 'Sample Ecore Model Editor' allows creating such associations,
I assumed that it works also with the OCLinEcore Editor.
However, according to my experience, this is not the case. In the following, there are a few examples:


-----WORKING EXAMPLE----------------------------------------------------------------------
-- This is the working example, it works perfect.
------------------------------------------------------------------------------------------
import ecore : 'http://www.eclipse.org/emf/2002/Ecore#/';

package tutorial : tut = 'http://www.eclipse.org/mdt/ocl/oclinecore/tutorial'
{
  class Library
  {
    property books#_'library' : Book[*] { composes };    
  }
  class Book
  {
    property _'library'#books : Library;
  }
}



-----NOT WORKING--------------------------------------------------------------------------
-- This does not work. The references between p1 and p2 seem not to be resolved. 
-- For the role opposites <xyz>, the OCLinEcore Editor shows the following error: 
-- "Couldn't resolve reference to ReferenceCS <xyz>".
------------------------------------------------------------------------------------------
import ecore : 'http://www.eclipse.org/emf/2002/Ecore#/';

package tutorial : tut = 'http://www.eclipse.org/mdt/ocl/oclinecore/tutorial'
{
  package pack1 : p1 = 'http://www.eclipse.org/mdt/ocl/oclinecore/tutorial/p1' {
	class Library
	{
	  property books#_'library' : tutorial::pack2::Book[*] { composes };    
	}
  }
  package pack2 : p2 = 'http://www.eclipse.org/mdt/ocl/oclinecore/tutorial/p2' {
    class Book
    {
      property _'library'#books : tutorial::pack1::Library;
    }
  }
}


-----NOT WORKING--------------------------------------------------------------------------
-- This does not work. The references between p1 and the parent package seem not to be resolved. 
-- For the role opposites <xyz>, the OCLinEcore Editor shows the following error: 
-- "Couldn't resolve reference to ReferenceCS <xyz>".
------------------------------------------------------------------------------------------
import ecore : 'http://www.eclipse.org/emf/2002/Ecore#/';

package tutorial : tut = 'http://www.eclipse.org/mdt/ocl/oclinecore/tutorial'
{
  package pack1 : p1 = 'http://www.eclipse.org/mdt/ocl/oclinecore/tutorial/p1' {
	class Library
	{
	  property books#_'library' : Book[*] { composes };    
	}
  }
  class Book
  {
    property _'library'#books : tutorial::pack1::Library;
  }
}


I appreciate any kind of help or comments.

Thank you very much!
Kind Regards.

[Updated on: Wed, 28 July 2010 16:32]

Report message to a moderator

Re: [OCLinEcore] Specifying bidirectional boundaries [message #550031 is a reply to message #549990] Wed, 28 July 2010 19:42 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi Fabian

I've raised https://bugs.eclipse.org/bugs/show_bug.cgi?id=321171 for this.

I'm afraid that it was quite a rush to get any form of editors into the
Helios release; they're not as robust as I would like. I'm hoping to do
substantially better in MDT/OCL 3.1.0 in October.

Regards

Ed Willink
Re: [OCLinEcore] Specifying bidirectional boundaries [message #551254 is a reply to message #550031] Thu, 05 August 2010 17:18 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi Fabian

> I've raised https://bugs.eclipse.org/bugs/show_bug.cgi?id=321171 for this.

A patch is now available.

Thanks for the excellent repro.

Regards

Ed Willink
Re: [OCLinEcore] Specifying bidirectional associations [message #551971 is a reply to message #549990] Tue, 10 August 2010 10:57 Go to previous message
Missing name Mising name is currently offline Missing name Mising nameFriend
Messages: 6
Registered: July 2010
Junior Member
Hi Ed,

Thank you very much for your help!
(...sorry for the late reply)

Kind Regards
Previous Topic:org.eclipse.ocl.examples.build plug-in
Next Topic:[OCLInEcore] Comments disappear when saving the .ecore file
Goto Forum:
  


Current Time: Sat Apr 20 03:19:42 GMT 2024

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

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

Back to the top