|What is the current status of this OCL in profiles issue? [message #777688]
||Tue, 10 January 2012 17:22
|| Tomas Balderas
Registered: July 2010
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:
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
|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
| Ed Willink
Registered: July 2009
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:
> 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
> 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:
> 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
> 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.
Powered by FUDForum
. Page generated in 0.01755 seconds