|Re: Integrating custom OCL rules with the Papyrus editor [message #1207463 is a reply to message #1207033]
||Sun, 24 November 2013 15:53
| Ed Willink
Registered: July 2009
I find the EMF Validation Constraints capability very limited. In
particular they are difficult to extend and only apply to plugged-in models.
The EMFv approach was the first attempt to make OCL useable. It was a
considerable step forward but defining OCL without the aid of any editor
tooling as XML CDATA is not very pleasant. This is the approach taken by
the EMF Facet declarations that you see. (OCL editor tooling is now much
improved by exploiting Xtext.)
Kepler added support for Constraints in stereotypes via EMFv, but you
have to validate before you can see them in the EMFv display; not very
You can use the Load Complete OCL Resource menu action to load an
additional OCL document that you can maintain using the Complete OCL
editor; see the OCL Documentation for tutorials and OCL in Papyrus. Make
sure you load the latest OCL Examples and Editors build; there have been
some important post-Kepler fixes.
Realistically, OCL constraints in Papyrus became possible with Kepler
but you need to be quite enthusiastic to live with a number of ergonomic
I am hoping to have a far superior constraints activation view, possibly
with debugging, for Luna.
On 24/11/2013 10:55, Matteo M. wrote:
> when you right-click on a model and select "Validation->Select constraints and Validate model" a dialog window opens; it features constraint categories, a description box and a list of constraints to be enabled for each category.
> I would like to add a custom constraint category to that dialog window, with a list of constraint rules defined by me. The picture below shows an example of what I would like to do (custom constraint category definition (RobotML rules), a set of applicable constraints and description).
> But I have no idea of where to start. How do I create a constraint category? Should I use the Java API? How do I nicely integrate my custom constraint category/constraint rules with the dialog window in Papyrus?
> Can someone point me to a good (clear) tutorial, or provide a minimal/dummy (but complete) example of how constraint rules are grouped into a category and are made available for selection through the Papyrus editor?
> Thank you in advance!
Powered by FUDForum
. Page generated in 0.01724 seconds