Need help for OCL Syntax [message #1434118] |
Mon, 29 September 2014 13:48  |
Eclipse User |
|
|
|
Hi
I'm using Papyrus 0.10.2 with Eclipse Kepler Release2. I put an OCL constraint in my profile which is attached to the stereotype "ObjectMultiviews" (that extends Lifeline Class). It means that the stereotype "ObjectMultiviews" is the context.
I want that the Lifeline stereotyped "ObjectMultiviews" could send messages only for Lifelines stereotyped "ObjectBase" and "ObjectMultiviews".
Here's the constraint I proposed:
self.base_Lifeline.getConnectorEnds()-> forAll (o | o.ConnectorEnd.Connector->exists (r|not r.type.getAppliedStereotype('AWSProfile::ObjectBase').oclIsUndefined() )and
o.ConnectorEnd.Connector ->exists (r|not r.type.getAppliedStereotype('AWSProfile::ObjectMultiviews').oclIsUndefined()))
The parser tell me that the operation "getConnectorEnds()" is unresolved.
Any ideas? Help me please...
Thank you
Regards
|
|
|
|
|
|
|
|
|
|
Re: Need help for OCL Syntax [message #1435518 is a reply to message #1434853] |
Wed, 01 October 2014 12:04   |
Eclipse User |
|
|
|
Hi
Your example contains a profile and many GIFs but no model.
What am I expected to do.
See: https://wiki.eclipse.org/OCL/ForumNetiquette
Every time you provide an unclear repro you waste my time and yours.
Regards
Ed Willink
On 30/09/2014 19:54, Walid Ban wrote:
> Hi Ed,
> I have a profile that contains stereotypes which extend the meta-class "Lifeline". These stereotypes are "ObjectBase", "ObjectMultiviews", "ObjectProviderView" and "ObjectHumanConsumer".
>
> The constraint (which must be created in my profile) tells that :an "ObjectMultiviews" Lifeline could only send messages to another "ObjectMultiviews" Lifeline or to an "ObjectBase" Lifeline.
>
> So, if for example, an "ObjectMultiviews" Lifeline sends a message to an "ObjectProviderView" Lifeline, an errors must be occured when I validate a model (on which my profile is applied).
>
> I uploaded the plug-in that contains my profile to see clearer. I use Kepler SR2, Papyrus v0.10.2 (note that I work at the same time with Eclipse Luna, Papyrus 1.0.0)
> Any solution please?
> Thank you
>
|
|
|
Re: Need help for OCL Syntax [message #1435628 is a reply to message #1435518] |
Wed, 01 October 2014 15:28  |
Eclipse User |
|
|
|
I'm sorry for wasting your time Ed...I didn't mean that..
May be you didn't understand what I want exactely..
I have a profile and I defined constraints in it.
The goal of creating a model and applying the profile on it, is just to check if the constraint defined in the profile works or not.
For the constraint:
self.base_Lifeline.connectorEnds->forAll(o |
o.ConnectorEnd.Connector
->exists(type.extension_ObjectBase <> null)
and o.ConnectorEnd.Connector
->exists(type.extension_ObjectMultiviews <> null))
The parser didn't accept "connectorEnds" (unresolved property UML::Lifeline::connectorEnds)
Also, it didn't accept "extension_ObjectBase" (unresolved property UML::Association::extension_ObjectBase). Well I think because "ObjectBase" is a stereotype that extends Lifeline Meta-class not Association Meta-Class
Any suggestion?
|
|
|
Powered by
FUDForum. Page generated in 0.33891 seconds