Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Adding constraints to UML Profiles in Papyrus(How to validate UML Profiles in Papyrus)
Adding constraints to UML Profiles in Papyrus [message #997587] Tue, 08 January 2013 13:38 Go to next message
André Ribeiro is currently offline André Ribeiro
Messages: 48
Registered: January 2013
Member
Hi,

Recently, I've developed my own UML Profile using Papyrus.
Now my doubt is how can I add/associate OCL constraints to it?
My goal is to validate if a model that applies my profile is correct or not.

I'm using the following version of Eclipse:
Eclipse Modeling Tools
Version: Juno Service Release 1
Build id: 20120920-0800

Thanks in advance,
André Ribeiro
IST Lisbon
Portugal


André Ribeiro
IST Lisbon
Portugal
Re: Adding constraints to UML Profiles in Papyrus [message #997589 is a reply to message #997587] Tue, 08 January 2013 13:56 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille Letavernier
Messages: 445
Registered: February 2011
Senior Member
Hello André,

This feature is not supported in the current version of Papyrus. It should be supported in 0.10 (June 2013, Eclipse Kepler)


Regards,
Camille


Camille Letavernier
Papyrus developer
Re: Adding constraints to UML Profiles in Papyrus [message #997688 is a reply to message #997589] Tue, 08 January 2013 14:55 Go to previous messageGo to next message
André Ribeiro is currently offline André Ribeiro
Messages: 48
Registered: January 2013
Member
Thanks for the answer Camille.
Is there any other way I can perform this validation?

Thank you once again.


André Ribeiro
IST Lisbon
Portugal
Re: Adding constraints to UML Profiles in Papyrus [message #997689 is a reply to message #997688] Tue, 08 January 2013 14:57 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille Letavernier
Messages: 445
Registered: February 2011
Senior Member
Hello,

I guess you can implement your constraints in a new EMF Validation plug-in. Papyrus relies on this mechanism for validating the models.


Regards,
Camille


Camille Letavernier
Papyrus developer
Re: Adding constraints to UML Profiles in Papyrus [message #997697 is a reply to message #997689] Tue, 08 January 2013 15:10 Go to previous messageGo to next message
Vlad Gheorghe is currently offline Vlad Gheorghe
Messages: 111
Registered: May 2011
Senior Member
Hello,

Just in case you need it - a tutorial is in the EMFV help:
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.emf.validation.doc/references/examples/oclValidationExample.html
(The link is from galileo - you should find it in the local help of your installation).

The feature shipping with Juno is:
EMF Validation Framework SDK 1.6.0.v20120328-0001-67T-96SGR75UNqZNTdeQnghI6uFA org.eclipse.emf.validation.sdk.feature.group Eclipse Modeling Project
(You get it if you install the Modelling package)

HTH
Vlad
Re: Adding constraints to UML Profiles in Papyrus [message #997725 is a reply to message #997697] Tue, 08 January 2013 16:03 Go to previous messageGo to next message
André Ribeiro is currently offline André Ribeiro
Messages: 48
Registered: January 2013
Member
Ok, I will explore that option.
Many thanks Camille and Vlad.


André Ribeiro
IST Lisbon
Portugal
Re: Adding constraints to UML Profiles in Papyrus [message #997749 is a reply to message #997725] Tue, 08 January 2013 16:58 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4037
Registered: July 2009
Senior Member
Hi

The EMFv OCL tutorial is seriously old; a patch was supplied for Juno
but never applied. https://bugs.eclipse.org/bugs/show_bug.cgi?id=327956

You won't get very far trying to get profile constraints to execute
since EMFv ignores stereotype applications.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=397508

You won't get very far trying to get profile constraints to execute
since there is no ConstraintProvider for UML Profiles.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=397519

These are problems I have fixed in the last week. You may find that
things are much better with the Kepler M5 release (3 Feb) of MDT/OCL
which can be installed on Juno.

Regards

Ed Willink
Re: Adding constraints to UML Profiles in Papyrus [message #997796 is a reply to message #997749] Tue, 08 January 2013 18:57 Go to previous messageGo to next message
André Ribeiro is currently offline André Ribeiro
Messages: 48
Registered: January 2013
Member
Hi Ed,

So you suggest that the best option for me right now is to wait for the Kepler M5 release (3 Feb) of MDT/OCL?

Thanks for the reply.


André Ribeiro
IST Lisbon
Portugal
Re: Adding constraints to UML Profiles in Papyrus [message #997837 is a reply to message #997749] Tue, 08 January 2013 21:06 Go to previous messageGo to next message
Vlad Gheorghe is currently offline Vlad Gheorghe
Messages: 111
Registered: May 2011
Senior Member
Hello everyone,

I have some additional comments.

1. I have used EMFv exactly as described in those tutorials and it worked with eclipse 3.7.2. So I think it's worth giving it a shot on 3.8 / 4.2.

2. I think EMFv, as it is, does have some advantages over alternate methods described in https://bugs.eclipse.org/bugs/show_bug.cgi?id=327956 .
* Constraints can be given IDs, can be grouped, documented and made visible for the user in the Properties pages.
* The oclinecore editor does not support any ecore model - so for the unsupported model the user has to edit the annotations with the sample ecore editor - which is cumbersome.
(e.g. eKeys are not supported - Is this still true ?)
* EMFv has support for live validation


3. @Andre: What exactly the constraints must constrain ? Do you have to access meta-properties defined by the stereotypes ?
If you only need standard meta-properties to express constraints, then EMFv should work.

Re: Adding constraints to UML Profiles in Papyrus [message #998024 is a reply to message #997837] Wed, 09 January 2013 08:01 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4037
Registered: July 2009
Senior Member
Hi

On 08/01/2013 21:06, Vlad Gheorghe wrote:
> 1. I have used EMFv exactly as described in those tutorials and it
> worked with eclipse 3.7.2. So I think it's worth giving it a shot on
> 3.8 / 4.2.
In addition to the UMLProfileConstraintProvider, you may find the new
CompleteOCLConstraintProvider useful in M5. This makes the Complete OCL
constraints visible in the Preference pages.
>
> 2. I think EMFv, as it is, does have some advantages over alternate
> methods described in
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=327956 .
> * Constraints can be given IDs, can be grouped, documented and made
> visible for the user in the Properties pages.
There is a faint possibility that
http://wiki.eclipse.org/MDT/OCL/Debugger#The_Validations_View might
appear for Kepler.
> * The oclinecore editor does not support any ecore model - so for the
> unsupported model the user has to edit the annotations with the sample
> ecore editor - which is cumbersome.
> (e.g. eKeys are not supported - Is this still true ?)
https://bugs.eclipse.org/bugs/show_bug.cgi?id=324924 was fixed for
Indigo (20 months ago).

> * EMFv has support for live validation
>
>
> 3. @Andre: What exactly the constraints must constrain ? Do you have
> to access meta-properties defined by the stereotypes ?
> If you only need standard meta-properties to express constraints,
> then EMFv should work.
Without a UMLTraversalStrategy, the stereotypeApplication will never be
self and so no Constraint attached to a Stereotype will be evaluated.

Regards

Ed Willink
Re: Adding constraints to UML Profiles in Papyrus [message #998666 is a reply to message #998024] Thu, 10 January 2013 13:16 Go to previous messageGo to next message
André Ribeiro is currently offline André Ribeiro
Messages: 48
Registered: January 2013
Member
Hi,

Quote:
3. @Andre: What exactly the constraints must constrain ? Do you have to access meta-properties defined by the stereotypes ?
If you only need standard meta-properties to express constraints, then EMFv should work.


Answering to Vlad's question I will present an excerpt of my UML Profile metamodel:

index.php/fa/12933/0/

For instance, if the user defines a Class XisInteractionCompositeElement with compositeElementType == 'List', it can only be composed of XisActionElements with actionElementType == 'ListItem'.
Is it possible to define such a constraint?

Thanks.


André Ribeiro
IST Lisbon
Portugal
Re: Adding constraints to UML Profiles in Papyrus [message #998690 is a reply to message #998666] Thu, 10 January 2013 14:08 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4037
Registered: July 2009
Senior Member
HI

I think you may have misunderstood 'Profile'; your example is not a
profile and has no user-defined stereotypes, so you are only using
ordinary constraints.

Regards

Ed Willink

On 10/01/2013 13:16, André Ribeiro wrote:
> Hi,
>
> Quote:
>> 3. @Andre: What exactly the constraints must constrain ? Do you have to access meta-properties defined by the stereotypes ?
>> If you only need standard meta-properties to express constraints, then EMFv should work.
>
> Answering to Vlad's question I will present an excerpt of my UML Profile metamodel:
>
>
>
> For instance, if the user defines a Class XisInteractionCompositeElement with compositeElementType == 'List', it can only be composed of XisActionElements with actionElementType == 'ListItem'.
> Is it possible to define such a constraint?
>
> Thanks.
>
Re: Adding constraints to UML Profiles in Papyrus [message #998711 is a reply to message #998690] Thu, 10 January 2013 14:42 Go to previous messageGo to next message
André Ribeiro is currently offline André Ribeiro
Messages: 48
Registered: January 2013
Member
Hi Ed,

Probably I wasn't clear.
What I've presented above is the metamodel (where the UML metaclasses were omitted) and not a model that applies my Profile.
XisInteractionSpace, XisWidget, XisInteractionCompositeElement and so on, are indeed stereotypes that can be applied to classes.
XisOperation is a stereotype that can be applied to operations, while XisArgument can be applied to arguments of a XisOperation.


André Ribeiro
IST Lisbon
Portugal
Re: Adding constraints to UML Profiles in Papyrus [message #999220 is a reply to message #998711] Fri, 11 January 2013 15:26 Go to previous messageGo to next message
Vlad Gheorghe is currently offline Vlad Gheorghe
Messages: 111
Registered: May 2011
Senior Member
Hi Andre,

This looks interesting.

1. What tool are you currently using ?

2. Can you provide a diagram showing the relationship between the stereotypes and UML meta-classes ?

3. Can you provide the source of the profile ?

Regards
Vlad
Re: Adding constraints to UML Profiles in Papyrus [message #999291 is a reply to message #999220] Fri, 11 January 2013 18:36 Go to previous messageGo to next message
André Ribeiro is currently offline André Ribeiro
Messages: 48
Registered: January 2013
Member
Hi Vlad,

Quote:
1. What tool are you currently using ?

I'm using Papyrus, but I've used Enterprise Architect to model the previous excerpt of the profile.

Quote:
2. Can you provide a diagram showing the relationship between the stereotypes and UML meta-classes ?

Here is what I've done so far:

index.php/fa/12962/0/

Quote:
3. Can you provide the source of the profile ?

Yes, I can provide you my Papyrus Project.

Quote:
For instance, if the user defines a Class XisInteractionCompositeElement with compositeElementType == 'List', it can only be composed of XisActionElements with actionElementType == 'ListItem'.
Is it possible to define such a constraint?

Can you please give some feedback about this?

Thank you!
  • Attachment: XisMobile.png
    (Size: 92.71KB, Downloaded 584 times)


André Ribeiro
IST Lisbon
Portugal

[Updated on: Mon, 14 January 2013 16:37]

Report message to a moderator

Re: Adding constraints to UML Profiles in Papyrus [message #1001964 is a reply to message #999291] Thu, 17 January 2013 16:10 Go to previous messageGo to next message
André Ribeiro is currently offline André Ribeiro
Messages: 48
Registered: January 2013
Member
Hello!

Vlad, can you please answer my question?
Is it possible to validate a model that uses my profile?

Thank you!


André Ribeiro
IST Lisbon
Portugal
Re: Adding constraints to UML Profiles in Papyrus [message #1002576 is a reply to message #1001964] Fri, 18 January 2013 21:43 Go to previous messageGo to next message
Vlad Gheorghe is currently offline Vlad Gheorghe
Messages: 111
Registered: May 2011
Senior Member
Hi Andre,

It is interesting that you are extending UML for this purpose.
I guess one major advantage is that you get a diagram editor with a small effort.

Well, as Camille stated here, Papyrus does not support this feature yet.
Also, as Ed said here, an EMFV-based solution would not work either at the moment.

Looking at your meta-model it seems like a quite heavy extenstion to UML.
You might consider defining your own stand-alone metamodel by using EMF/Ecore.
But in that would mean that you cannot use the Papyrus UML diagram editor for your models.
You could get a working editor for your language by using Graphiti.
But I haven't tried it myself.

You could find some ideas in the Eclipse DSL book (rather outdated).


Maybe somebody else has some better recommendations.

Best wishes
Vlad
Re: Adding constraints to UML Profiles in Papyrus [message #1006403 is a reply to message #997587] Thu, 31 January 2013 09:20 Go to previous messageGo to next message
Patrik Nandorf is currently offline Patrik Nandorf
Messages: 9
Registered: January 2013
Location: Sweden
Junior Member
Any guess on when this would be available?

Regards
Patrik
Re: Adding constraints to UML Profiles in Papyrus [message #1006521 is a reply to message #1006403] Thu, 31 January 2013 14:53 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4037
Registered: July 2009
Senior Member
Hi

It depends how close to the bleeding edge you like to be.

June: Kepler
End of next week: M5
Now: Latest Papyrus N-build, and MDT/OCL build from
https://hudson.eclipse.org/hudson/job/buckminster-mdt-ocl-branch-tests/
(might be an I-build tomorrow)

Realistically, I recommend that you wait for M5, and then report any
problems that you find so that may be fixed for M6.

OCL entry for profiles appears to work; see picture on my recent OCL
newsgroup posting.

Diagram validation using profile OCL is active work in progress; it
might be working but it probably isn't.

Regards

Ed Willink

On 31/01/2013 14:23, Patrik Nandorf wrote:
> Any guess on when this would be available?
>
> Regards
> Patrik
Re: Adding constraints to UML Profiles in Papyrus [message #1007843 is a reply to message #1006521] Thu, 07 February 2013 17:24 Go to previous messageGo to next message
André Ribeiro is currently offline André Ribeiro
Messages: 48
Registered: January 2013
Member
Hi Ed,

Is it now possible (with the release of M5) to perform such a validation?

Thanks.


André Ribeiro
IST Lisbon
Portugal
Re: Adding constraints to UML Profiles in Papyrus [message #1007998 is a reply to message #1007843] Thu, 07 February 2013 18:24 Go to previous message
Ed Willink is currently offline Ed Willink
Messages: 4037
Registered: July 2009
Senior Member
Hi

To be honest I haven't tried recently; I've been working on a scoping
bug for direct use of base_xxx and extension_xxx at M1.

In principle, you just need to enable the Profile constraints in the
Window->Preferences->Model Validation window (they won't appear till
you've validated once) then Validate again.

Regards

Ed Willink


On 07/02/2013 17:25, André Ribeiro wrote:
> Hi Ed,
>
> Is it now possible (with the release of M5) to perform such a validation?
>
> Thanks.
Previous Topic:exporting sysML diagrams to Eclipse plugin
Next Topic:Centering description in use-case diagram
Goto Forum:
  


Current Time: Tue Sep 02 23:52:50 GMT 2014

Powered by FUDForum. Page generated in 0.02718 seconds