Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » how to use OCL to set constrains?
how to use OCL to set constrains? [message #986375] Tue, 20 November 2012 09:33 Go to next message
Iqbal Hossain is currently offline Iqbal HossainFriend
Messages: 101
Registered: May 2011
Location: Bangladesh
Senior Member
As i have seen in several place where OCL expression is used to put some constraints. In gmfmap if we do the followings,
Audit Container->Audit rule->Constraint,
we may include some OCL expression in Body part. I want to know how can i generate this OCL expression?

lets give a example: suppose i have nodeA and nodeB. I can draw only 1 line between them. not more than 1 or not 0.
or may be...there is a attribute of nodeA is rate. rate is a integer value and it should be between 50-100.

So to implement these constraints usually OCL is used(as i have seen).

but i cannot make my own OCL expression. what i have find in different tutorial is for those design only. How can i make OCL expression for my own design?

I hope i make you understand. If you have a question to answer my question, please ask me.
Re: how to use OCL to set constrains? [message #986395 is a reply to message #986375] Tue, 20 November 2012 10:24 Go to previous messageGo to next message
Ralph Gerbig is currently offline Ralph GerbigFriend
Messages: 702
Registered: November 2009
Senior Member
Hi Iqbal,

where do you want to add constraints, in you ecore model or in the GMF editor? You can do both. For adding constraints to you Ecore model you should take a look at the MDT OCL Project especially OCLInEcore Editor. If you want to add constraints to the GMF Editor you should take a look at the GMF Map model. You can e.g. specify link constraints by right clicking your link mapping and add a link constraint to it. You can also use OCL to setup model elements on creation or have dynamic figures.

Ralph
Re: how to use OCL to set constrains? [message #986401 is a reply to message #986395] Tue, 20 November 2012 10:31 Go to previous message
Iqbal Hossain is currently offline Iqbal HossainFriend
Messages: 101
Registered: May 2011
Location: Bangladesh
Senior Member
Thanks Ralph... I will go through what you told here. If i have problem i will ask here again Smile
Previous Topic:how to center align the label name in gmfgraph?
Next Topic:GMF and Drools integration
Goto Forum:
  


Current Time: Wed Jan 15 12:28:07 GMT 2025

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

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

Back to the top