1

I want to define some constraints for my profile. For example I need a constraint for a stereotype of the metaclass "connector". I want to define that these element must have one source like the oclkindof(source) and one target like the oclkindof(target). I found some texts by using the Google search engine like http://modeling-languages.com/wp-content/uploads/2012/03/OCLChapter.pdf or http://www.omg.org/spec/OCL/2.0/ and other slides and papers but not the right description of OCL for me.

Best regards

MFY
  • 11
  • 2
  • 1
    For what reason do you want to use OCL? There are only few tools that can interpret OCL. In most cases a simple constraint in plain language is fine. – qwerty_so Mar 10 '15 at 20:21
  • Thank you for your answer. I want use it to define some constraints with a standard language in my master thesis. First I want to describe the constraint in plain language and then i want to transform it in OCL. – MFY Mar 12 '15 at 14:34
  • Due to the lack of tooling OCL is only/mostly used in academic circles. The best I can suggest is to write the OCL to your best knowledge and then post it here as a question asking whether it's correct. Additionally you might look for OCL interpreters (I'm pretty sure there are some; Enterprise Architect can at least check the syntax). (http://www.dresden-ocl.org/index.php/DresdenOCL) – qwerty_so Mar 12 '15 at 21:35
  • Thanks for your help. Than I define some constraints in OCL and ask here if it right. I found some interpreters but I don't know if I use them right. – MFY Mar 16 '15 at 08:17

1 Answers1

0

How to attach OCL constraints to metamodels (e.g. via stereotypes) used to vary from tool to tool.

For your project, using the Eclipse Papyrus project should suffice, which should support what you need.

In Papyrus, you can also try out OCL queries in the console on the current UML model before you store them in the profile.

Volker Stolz
  • 7,274
  • 1
  • 32
  • 50