Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Integrating custom OCL rules with the Papyrus editor
Integrating custom OCL rules with the Papyrus editor [message #1207033] Sun, 24 November 2013 10:55 Go to next message
Matteo M. is currently offline Matteo M.Friend
Messages: 40
Registered: May 2012
Member
Hello,

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).
index.php/fa/16805/0/

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!
--
Matteo
Re: Integrating custom OCL rules with the Papyrus editor [message #1207463 is a reply to message #1207033] Sun, 24 November 2013 15:53 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6798
Registered: July 2009
Senior Member
Hi

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
clever.

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
limitations.

I am hoping to have a far superior constraints activation view, possibly
with debugging, for Luna.

Regards

Ed Willink



On 24/11/2013 10:55, Matteo M. wrote:
> Hello,
>
> 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!
> --
> Matteo
Previous Topic:MARTE and SysML stereotypes brake OCL text editor
Next Topic:Going for a milestone release..
Goto Forum:
  


Current Time: Fri Aug 14 06:46:43 GMT 2020

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

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

Back to the top