Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » [UML] Set up a profile with OCL constraints
[UML] Set up a profile with OCL constraints [message #51469] Thu, 28 February 2008 15:16 Go to next message
Eclipse UserFriend
Originally posted by: stefan.bley.saxsys.de

Hello,
I'm rather new to OCL.

I would like to create a UML profile as a DSL. This of course includes
constraints to ensure integrity of model instances. E.g. I want to
define "A class with stereotype A may not hold an association to a class
with stereotype B."

1) Can I attach such a constraint to the stereotype using the tree editor?
2) Does the graphical UML editor from UMLTools automatically prevent me
e.g. to draw an association from a <<A>> class to a <<B>> class?

Thanks for your help,
Stefan
Re: [UML] Set up a profile with OCL constraints [message #51593 is a reply to message #51469] Thu, 28 February 2008 20:12 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Stefan,

Yes, the "Create Child" menu in the UML editor should have an
"Owned Rule -> Constraint" action to create a new constraint. You would
then create an OpaqueExpression in the specification property of this
constraint, set its language attribute to OCL and put your OCL expression
in the body.

I don't know the extent to which the UML2Tools editors discover and enforce
constraints. I expect that it does not discover link constraints of this
kind from profiles etc. However, you would be best to ask on the
org.eclipse.mdt.uml2tools newsgroup about that; there may be capabilities
in those tools that I don't know about.

HTH,

Christian


Stefan Bley wrote:

> Hello,
> I'm rather new to OCL.
>
> I would like to create a UML profile as a DSL. This of course includes
> constraints to ensure integrity of model instances. E.g. I want to
> define "A class with stereotype A may not hold an association to a class
> with stereotype B."
>
> 1) Can I attach such a constraint to the stereotype using the tree editor?
> 2) Does the graphical UML editor from UMLTools automatically prevent me
> e.g. to draw an association from a <<A>> class to a <<B>> class?
>
> Thanks for your help,
> Stefan
Previous Topic:[Announce] MDT OCL 1.1.2 is available
Next Topic:RE: OCL Metamodel in ECore
Goto Forum:
  


Current Time: Sun Dec 21 17:21:21 GMT 2014

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

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