What is the current status of this OCL in profiles issue? [message #777688] |
Tue, 10 January 2012 17:22  |
Eclipse User |
|
|
|
Hello everybody
I am currently validating that an activity model is compliant with certain rules by using a set of queries in a transformation tool I wrote in Acceleo. If the diagram meets the rules then the transformation tool generates code in a hardware description language. Now, I want to define a profile to add special icons and express the rules using OCL constraints. I got stuck.
I read the following threads regarding support for OCL in Papyrus:
http://www.eclipse.org/forums/index.php/t/206602/
http://www.eclipse.org/forums/index.php/t/197674/
http://www.eclipse.org/forums/index.php/m/672521/
My conclusion is that it was not possible to add constraints to stereotypes and enable automatic evaluation before Eclipse Indigo. One of the threads mentioned a so called Xtext editor that was going to be available in Eclipse Indigo to add OCL constraints.
I also checked some tutorials about the stand-alone version of Papyrus that did allow addition of OCL code, but that feature seems to be no longer present in Papyrus for Eclipse.
Could you please let me know if nowadays I can add OCL code to stereotypes and check activity models using such restrictions?
Thanks a lot for your help
/T
|
|
|
|
|
Re: What is the current status of this OCL in profiles issue? [message #778462 is a reply to message #778226] |
Wed, 11 January 2012 15:24  |
Eclipse User |
|
|
|
Hi Tomas
Comments in line.
On 11/01/2012 19:28, Tomas Balderas wrote:
> Hi Edward
>
> Your reply has been greatly illustrative for me, as well as the
> tutorial found here:
>
> http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.ocl.doc%2Fhelp%2FGettingStarted.html
>
>
> Please correct me if I am wrong. My conclusions are as follows:
>
> 1. Specifying OCL code for a modeling element and executing such OCL
> code is only possible when such model is made up of instances of
> meta-classes of the Ecore meta-model.
This was the case with the old UML/Ecore bindings for Eclipse OCL.
The new Eclipse OCL in the examples is intemded to be UML-aligned so
there is a Class rather than EClass meta-class.
> 2. I would need to convert a UML model to Ecore to add and execute OCL
> constraints. But this might not work.
Today probably yes. The goal is to make it work in UML just like you
would hope.
> 3. I am working with activity diagrams in UML 2. Therefore, I cannot
> convert an activity model in UML 2 to Ecore because there are no
> meta-classes in Ecore that correspond to the meta-classes in UML 2 for
> activity models. At least, I cannot find any here:
>
> http://download.eclipse.org/modeling/emf/emf/javadoc/2.7.0/org/eclipse/emf/ecore/package-summary.html#details
>
>
> Am I correct? Please comment :roll:
It is very easy to get confused about meta-levels. When dealing with
stereotypes OCLK evaluation is at M1 rather than M0. Activity should be
properly modeled.
> In addition, I understood from one of your comments that the
> specification of UML 2 does not imply that a profile shall introduce
> restrictions from an application domain using constraints in OCL. Is
> this correct?
I'm not sure quite what you mean; the one and a half negatives confuse me.
In general, I feel OCL should just work to allow the non-graphical parts
of a UML model to be elaborated.
Regards
Ed Willink
|
|
|
Powered by
FUDForum. Page generated in 0.03894 seconds