Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Link Restriction
Link Restriction [message #215663] Fri, 16 January 2009 21:07 Go to next message
Eclipse UserFriend
Hi All,

I need to add restrictions on my Link. I have the following problem:

http://img205.imageshack.us/my.php?image=modelhg6.jpg

A class with an element of the enum type that contains 4 EEnumLiteral
(Goal, Task, Resource and Softgoal). Desire to have a connection only
between the elements Goal and Task, ie Softgoal and Resource can not use
the link MeansEnd.

Help me!

Thanks,
Josias Paes
Re: Link Restriction [message #215702 is a reply to message #215663] Sat, 17 January 2009 05:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jgreen.upb.de

Josias,
you can add an OCL Constraint to your link mapping. Set "language" to "ocl" and write your constraint expression into
the body. See http://wiki.eclipse.org/GMF_Tutorial_Part_2#Link_Constraints

Try something like

(self.source.type = 0 and self.target.type = 2) or (self.source.type = 2 and self.target.type = 0)

"self" refers to your MeansEnd element and I assume that your enum literal are numbered such that GOAL = 0 and TASK = 2.

Joel


Josias Paes wrote:
> Hi All,
>
> I need to add restrictions on my Link. I have the following problem:
>
> http://img205.imageshack.us/my.php?image=modelhg6.jpg
>
> A class with an element of the enum type that contains 4 EEnumLiteral
> (Goal, Task, Resource and Softgoal). Desire to have a connection only
> between the elements Goal and Task, ie Softgoal and Resource can not use
> the link MeansEnd.
>
> Help me!
>
> Thanks,
> Josias Paes
>
>
>
Re: Link Restriction [message #215754 is a reply to message #215702] Sat, 17 January 2009 10:59 Go to previous message
Eclipse UserFriend
Thank you Joel,

I got the following:

Source end Constraint - self.type=ElementType::GOAL
Target end Constraint - self.type=ElementType::TASK


Its tip was valuable thanks!
Josias
Previous Topic:Notation package spec or doc ?
Next Topic:Compatment problem
Goto Forum:
  


Current Time: Thu May 08 23:33:50 EDT 2025

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

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

Back to the top