how to use OCL to set constrains? [message #986375] |
Tue, 20 November 2012 09:33  |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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
|
|
|
|
Powered by
FUDForum. Page generated in 0.03027 seconds