[OCLinEcore] Specifying bidirectional associations [message #549990] |
Wed, 28 July 2010 16:31 |
Missing name Mising name 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
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02680 seconds