Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » validating OCL constraints
validating OCL constraints [message #1469514] Tue, 11 November 2014 17:25 Go to next message
Ameni BF is currently offline Ameni BFFriend
Messages: 8
Registered: November 2014
Junior Member
Hello,

I created a UML model with two classes (User and Role) and an association between them. I also defined a cardinality constraint which states that a user should have only two roles. When loading the OCL file to validate it on an instance of the model I had the following error message:
Unresolved Property 'model::User: roles'

Does anyone knows the reason please?
  • Attachment: model.png
    (Size: 26.63KB, Downloaded 210 times)
  • Attachment: oclConstraint.png
    (Size: 21.67KB, Downloaded 219 times)
  • Attachment: error.png
    (Size: 29.35KB, Downloaded 192 times)
Re: validating OCL constraints [message #1469536 is a reply to message #1469514] Tue, 11 November 2014 17:48 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 5838
Registered: July 2009
Senior Member
Hi

Ought to work, but:

You don't tell us what versions you are using. EClipse UML2 only
recently enabled its conversion of package names to Java names to be
compensated by OCL.

You provide pretty pictures but no models so you hide most of your error
opportunities. https://wiki.eclipse.org/OCL/ForumNetiquette

Regards

Ed Willink

On 11/11/2014 17:25, Ameni BF wrote:
> Hello,
>
> I created a UML model with two classes (User and Role) and an association between them. I also defined a cardinality constraint which states that a user should have only two roles. When loading the OCL file to validate it on an instance of the model I had the following error message:
> Unresolved Property 'model::User: roles'
>
> Does anyone knows the reason please?
>
Re: validating OCL constraints [message #1469545 is a reply to message #1469536] Tue, 11 November 2014 18:00 Go to previous messageGo to next message
Ameni BF is currently offline Ameni BFFriend
Messages: 8
Registered: November 2014
Junior Member
Hi,

Thank you for you message. I am using Eclipse Kepler (4.3). Regarding the pictures, I made some screenshots of my project. It would be so kind if you can tell me what do you mean by ('no models').
Re: validating OCL constraints [message #1469572 is a reply to message #1469545] Tue, 11 November 2014 18:27 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 5838
Registered: July 2009
Senior Member
HI

Kepler is nearly two ywars old. You are not even using its service releases.

No models. Well how do I load anything to see what mistakes you are
hiding? https://wiki.eclipse.org/OCL/ForumNetiquette

Regards

Ed Willink


On 11/11/2014 18:00, Ameni BF wrote:
> Hi,
>
> Thank you for you message. I am using Eclipse Kepler (4.3). Regarding
> the pictures, I made some screenshots of my project. It would be so kind
> if you can tell me what do you mean by ('no models').
Re: validating OCL constraints [message #1470276 is a reply to message #1469572] Wed, 12 November 2014 08:02 Go to previous messageGo to next message
Ameni BF is currently offline Ameni BFFriend
Messages: 8
Registered: November 2014
Junior Member
Hi,
I tried the same example on Eclipse Luna (4.4.1). I had the same error when I tried to load the complete OCL file on the UML model (OCL->Load Document).
Re: validating OCL constraints [message #1470289 is a reply to message #1470276] Wed, 12 November 2014 08:12 Go to previous message
Ameni BF is currently offline Ameni BFFriend
Messages: 8
Registered: November 2014
Junior Member
I have a new error which states that:

org.eclipse.uml2.uml.internal.impl.ModelImp cannot be cast to org.eclipse.emf.ecore.EPackage

I am using Eclipse Luna:

-Eclipse Modeling Tools 2.0.2.20140224-0000 epp.package.modeling
-OCL All-In-One SDK 5.0.2.v20140819-1612 org.eclipse.ocl.master.feature.group Eclipse Modeling Project
-OCL Examples and Editors SDK 3.4.2.v20140819-1612 org.eclipse.ocl.examples.feature.group Eclipse Modeling Project
-Papyrus UML (Incubation) 0.10.2.v201402191554 org.eclipse.papyrus.sdk.feature.feature.group Eclipse Modeling Project
Previous Topic:Restrict stereotypes with constraints
Next Topic:OCL Inheritance
Goto Forum:
  


Current Time: Mon Apr 23 17:53:52 GMT 2018

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

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