Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » What is the current status of this OCL in profiles issue?(Need to know it it is possible to add OCL constraints to stereotypes and evaluate such constraints)
What is the current status of this OCL in profiles issue? [message #777688] Tue, 10 January 2012 22:22 Go to next message
Tomas Balderas is currently offline Tomas BalderasFriend
Messages: 64
Registered: July 2010
Member
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


/TB
Re: What is the current status of this OCL in profiles issue? [message #777966 is a reply to message #777688] Wed, 11 January 2012 08:12 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi Tomas

There are two parts to your question:

Ergonomic: how is OCL editable for stereotypes/profiles in Papyrus?

The EssentialOCL Xtext editor was made available (in Indigo) for use
within Class diagrams and I have checked that a simple invariant is
editable. I do not know how extensive the integration is for OCL editing
in all possible contexts.

Functional: how does OCL work on stereotypes/profiles?

I have been trying to understand this and discussing it with the UML 2.5
team. The simplified specification may be significantly clearer.
Currently there is only a single example in the UML spec and nothing in
the OCL spec. My understanding is that a stereotype declaration creates
an extension relationship between X and Y which is realised by an
association A_base_X_extension_Y with ends base_X and extension_Y. These
names are then useable in OCL navigation expressions.

The OCL support associated with the EssentialOCL Xtext editor currently
operates on Ecore models and uses the UML2Ecore converter to allow usage
within Papyrus. In so far as Papyrus correctly provides base_X and
extension_Y and the UML2Ecore converter correctly converts them; it
might just work. I have certainly seen base_X style names appearing in
Ecore models.

It just requires Papyrus to use an OCL aware EValidator such as the
OCLinEcoreEObjectValidator or CompleteOCLEObjectValidator to Validate.

There are quite a few provisos in the above, so I very much doubt that
it works.

I can understand the Papyrus team not rushing to try to make the above
work until the new OCL has direct support for UML at which point an
OCLinUMLEObjectValidator should make it all easy.

The lack of direct support for UML in the new Eclipse OCL is becoming a
significant hindrance to preparing model-generated UML and OCL
specifications, so expect a solution to this soon. Hopefully for Juno.

Regards

Ed Willink



On 10/01/2012 22:22, Tomas Balderas wrote:
> 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 #778226 is a reply to message #777966] Wed, 11 January 2012 19:28 Go to previous messageGo to next message
Tomas Balderas is currently offline Tomas BalderasFriend
Messages: 64
Registered: July 2010
Member
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.
2. I would need to convert a UML model to Ecore to add and execute OCL constraints. But this might not work.
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 Rolling Eyes

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 really appreciate your help. I am waiting for your answers.

Kindest regards.

/T


/TB
Re: What is the current status of this OCL in profiles issue? [message #778462 is a reply to message #778226] Wed, 11 January 2012 20:24 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
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
Previous Topic:Programmatically configure visible palette for diagram
Next Topic:Missing requirements when installing Papyrus
Goto Forum:
  


Current Time: Sat Apr 20 00:33:12 GMT 2024

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

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

Back to the top