Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » OCL constraints on stereotypes
OCL constraints on stereotypes [message #1046896] Mon, 22 April 2013 14:08 Go to next message
Vincent Verdier is currently offline Vincent Verdier
Messages: 12
Registered: April 2013
Junior Member
Hi everyone,

I'm using Papyrus on Eclipse Juno and I have definied an OCL constraint on a stereoptype. Unfortunately, Papyrus doesn't seem to check this kind of constraints. I also tried on Eclipse Kelpler.

What can I do in order to check the OCL constraints that I have defined in a profile ?

Any help would be much appreciate.
Thanks.
Re: OCL constraints on stereotypes [message #1046925 is a reply to message #1046896] Mon, 22 April 2013 14:53 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille Letavernier
Messages: 454
Registered: February 2011
Senior Member
Hi Vincent,

It's currently work in progress in Kepler. Most of the features should work on the latest nightly builds (Define constraints in the profile, validate models on which the profile is applied). You need the latest Papyrus and OCL builds.

Regards,
Camille


Camille Letavernier
Papyrus developer
Re: OCL constraints on stereotypes [message #1046949 is a reply to message #1046925] Mon, 22 April 2013 15:33 Go to previous messageGo to next message
Vincent Verdier is currently offline Vincent Verdier
Messages: 12
Registered: April 2013
Junior Member
Thanks for your answer.

So I downloaded the latest nightybuild of Papyrus from :
http://download.eclipse.org/modeling/mdt/papyrus/updates/nightly/kepler

Then I have tried to validate a very simple test. I got this exception :

Error	An exception occurred while delegating evaluation of the 'Constraint1' invariant on 'Test 0 -> <<test>> <Class> Class1': null	Test 0 -> <<test>> <Class> Class1	null	EMF Problem


Did I do something wrong or is this due to the nightybuild ?
Re: OCL constraints on stereotypes [message #1046982 is a reply to message #1046949] Mon, 22 April 2013 16:30 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille Letavernier
Messages: 454
Registered: February 2011
Senior Member
Hi,

Do you have a more precise message? e.g. the message from the root exception? (An OCL exception, probably)

What did you write on your OCL constraint?


Camille


Camille Letavernier
Papyrus developer
Re: OCL constraints on stereotypes [message #1047027 is a reply to message #1046949] Mon, 22 April 2013 17:37 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4045
Registered: July 2009
Senior Member
Hi

Camille wrote to use the latest OCL and Papyrus. Your message suggests
that you used only Papyrus nightly.

You should also use the latest Xtext ... all of which are available from
http://download.eclipse.org/releases/staging.

Regards

Ed Willink



On 22/04/2013 16:33, Vincent Verdier wrote:
> Thanks for your answer.
>
> So I downloaded the latest nightybuild of Papyrus from :
> http://download.eclipse.org/modeling/mdt/papyrus/updates/nightly/kepler
>
> Then I have tried to validate a very simple test. I got this exception :
>
> Error An exception occurred while delegating evaluation of the
> 'Constraint1' invariant on 'Test 0 -> <<test>> <Class> Class1':
> null Test 0 -> <<test>> <Class> Class1 null EMF Problem
>
>
> Did I do something wrong or is this due to the nightybuild ?
Re: OCL constraints on stereotypes [message #1047437 is a reply to message #1046896] Tue, 23 April 2013 07:48 Go to previous messageGo to next message
Vincent Verdier is currently offline Vincent Verdier
Messages: 12
Registered: April 2013
Junior Member
The problem is resolved. You were right, I forgot to update OCL to the latest nightlybuild...
Thank you both of you.
Re: OCL constraints on stereotypes [message #1047725 is a reply to message #1046982] Tue, 23 April 2013 15:09 Go to previous messageGo to next message
Walid Ban is currently offline Walid Ban
Messages: 31
Registered: January 2013
Member
Hi,
I installed Papyrus latest nightly build (0.10.0.v201304222226) and OCL last nightly build (4.1.0.v20130423-0101) and Xtext SDK (2.4.1.v201304180855).
I added the following constraint attached to the stereotype "Provider" that extend "Actor" (it means that the context is Provider):

self.base_Actor.getAssociations()-> forAll (a | a.memberEnd->exists (r|r.type.oclIsKindOf (ServiceInteraction)) and
a.memberEnd ->exists (r|r.type.oclIsKindOf (ServicePublication)) and
a.memberEnd->exists (r|r.type.oclIsKindOf (ServiceSearch)))

Note that "ServiceInteraction","ServicePublication" and "ServiceSearch" are stereotypes that extend "Use Case"


It doesn't contain errors. I tried to verify the constraint, i made an assocaition between an Actor stereotyped "Provider" and a Use Case stereotyped "ServiceComposition".But when i validate the model that apply my profile (open *.uml-->right click on the model-->validate), the validation is successful!
I'm confused between 2 things:
- The constraint is badly described and so it doesn't work or
- Something wrong with the validation Task in Papyrus.

Could you help me please..Thank you
Regards


Re: OCL constraints on stereotypes [message #1047741 is a reply to message #1047725] Tue, 23 April 2013 15:34 Go to previous messageGo to next message
Camille Letavernier is currently offline Camille Letavernier
Messages: 454
Registered: February 2011
Senior Member
Hi,

A lead:


- a.memberEnds is a UML feature. This means that it returns instances of UML Elements (Which might be stereotyped with ServiceInteraction). It *won't* return instances of ServiceInteraction (Or any other stereotype). a is an Association, memberEnd contains Properties, r is a Property, and r.type is a UML Type. So you should type something like: not r.type.getAppliedStereotype(yourProfile::ServiceInteraction).oclIsUndefined()

However, this constraint should fail during validation.

> But when i validate the model that apply my profile (open *.uml-->right click on the model-->validate), the validation is successful!

You should use Papyrus to validate profiled models defined in Papyrus. Or, at least, use the latest UML integration build.


Regards,
Camille


Camille Letavernier
Papyrus developer
Re: OCL constraints on stereotypes [message #1047823 is a reply to message #1047741] Tue, 23 April 2013 17:51 Go to previous message
Walid Ban is currently offline Walid Ban
Messages: 31
Registered: January 2013
Member
Thank you a lot Camille...really!
It worked!
Best regards
Previous Topic:Which version of UML is supported for Papyrus?
Next Topic:Question about all the functionalities
Goto Forum:
  


Current Time: Tue Sep 16 23:29:39 GMT 2014

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

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