Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » problem with "source.constraint" Eugenia annotation (It seems that the ocl constraint is never added to gmfgen model)
problem with "source.constraint" Eugenia annotation [message #1062272] Thu, 06 June 2013 22:07 Go to next message
Ilias Gerostathopoulos is currently offline Ilias GerostathopoulosFriend
Messages: 3
Registered: June 2013
Junior Member
Hello,

I am just trying to add a simple OCL constraint to my diagram, the one that prohibits link self-reference.
Even though I can add it when manually by changing the gmfmap model, I cannot make it work with the Eugenia annotation ("source.constraint"). Is there a bug here? Or am I missing something? I am using the latest Epsilon bundle.

Here is a sample Emfatic code to reproduce the problem:

@namespace(uri="test", prefix="test")
@gmf(foo="bar")
package test;

@gmf.diagram(foo="bar")
class Test {
	val Clazz[*] classes;
	val Relation[*] relations;
}

@gmf.node(figure="rectangle")
class Clazz {
   attr String name;
}

@gmf.link(source="start", target="end", 
	source.constraint="self <> oppositeEnd") 
class Relation {
   ref Clazz[1] start;
   ref Clazz[1] end;
}


Thanks for any help!

Ilias
Re: problem with "source.constraint" Eugenia annotation [message #1062405 is a reply to message #1062272] Fri, 07 June 2013 14:33 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 594
Registered: January 2010
Location: Birmingham, UK
Senior Member

According to the bug report, this is only available in the latest interim version, and not in the latest stable version (1.0):

https://bugs.eclipse.org/bugs/show_bug.cgi?id=400569

Have you installed the latest interim release?

By the way, you forgot to define a label for Clazz, and the 'foo="bar"' bits are not necessary anymore:

@namespace(uri="test", prefix="test")
@gmf
package test;

@gmf.diagram
class Test {
	val Clazz[*] classes;
	val Relation[*] relations;
}

@gmf.node(figure="rectangle", label="name")
class Clazz {
   attr String name;
}

@gmf.link(source="start", target="end", 
	source.constraint="self <> oppositeEnd") 
class Relation {
   ref Clazz[1] start;
   ref Clazz[1] end;
}
Re: problem with "source.constraint" Eugenia annotation [message #1062421 is a reply to message #1062405] Fri, 07 June 2013 15:18 Go to previous messageGo to next message
Ilias Gerostathopoulos is currently offline Ilias GerostathopoulosFriend
Messages: 3
Registered: June 2013
Junior Member
Okay, getting the interim release was the solution. Thanks!

BTW, if you make a note of this on the starters' tutorial
http://www.eclipse.org/epsilon/doc/articles/eugenia-gmf-tutorial/
might help other newbies like myself not to get confused about which features are included in the stable release and which are not.
Re: problem with "source.constraint" Eugenia annotation [message #1062423 is a reply to message #1062421] Fri, 07 June 2013 15:20 Go to previous message
Ilias Gerostathopoulos is currently offline Ilias GerostathopoulosFriend
Messages: 3
Registered: June 2013
Junior Member
Ok, there is a note there already , my bad ! Very Happy
Previous Topic:Diagram Partitioning
Next Topic:HELP! java.lang.NullPointerException when editing .model
Goto Forum:
  


Current Time: Tue Apr 23 17:46:08 GMT 2024

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

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

Back to the top