| 
| [UML] Set up a profile with OCL constraints [message #51469] | Thu, 28 February 2008 10:16  |  | 
| Eclipse User  |  |  |  |  | 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 15:12  |  | 
| Eclipse User  |  |  |  |  | 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
 |  |  |  | 
Powered by 
FUDForum. Page generated in 0.12836 seconds