Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » OCL constraints on some properties of a dependency stereotype
OCL constraints on some properties of a dependency stereotype [message #1787075] Fri, 18 May 2018 12:49 Go to next message
MG Gharib is currently offline MG GharibFriend
Messages: 30
Registered: September 2014
Member
Dear all,

I'm trying to to define a constraint that checks some properties of a dependency.

I will describe what I'm trying to model since it may better describe the problem.

I have three stereotypes Actor, Information and Activity specilized from the Class Metaclass, and InfoProvision (relation between two actors concerning the provesion of information) specilized from the Dependency Metaclass as shown in the Figure.

I want to define a constraint on the actor stereotype that prevents it from providing an information depending on inforProvision stereotype to another actor unless there is an incoming infoProvision with the same information.

I was able to define constraints on the type of a dependency relying on "getAppliedStereotypes()". However, I was not able to define a constrasint on some properties of the dependency. I'm not sure if it is possible in OCL but I supposed it is that is why I'm asking the experts here.

The problem is how I can reach the value (at the instence level) of such dependency and compare its value with another dependency from the same type?

Any suggestion to solve this problem are appretiated

Thanks in advance
  • Attachment: OCL.PNG
    (Size: 19.11KB, Downloaded 163 times)
Re: OCL constraints on some properties of a dependency stereotype [message #1787077 is a reply to message #1787075] Fri, 18 May 2018 14:17 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

It is probably possible, but on the basis of the information you have provided. See https://wiki.eclipse.org/OCL/ForumNetiquette

If you are using Papyrus, you are using the Pivot-based OCL that has sensiuble typesafe stereotype navigation. It should not be necessary to use the type-unsafe getAppliedStereotypes().

Have you looked at https://help.eclipse.org/oxygen/index.jsp?topic=%2Forg.eclipse.ocl.doc%2Fhelp%2FOCLExamplesforUML.html

Have you experimented in the OCL Xtext Console?

Regards

Ed Willink
Re: OCL constraints on some properties of a dependency stereotype [message #1787080 is a reply to message #1787077] Fri, 18 May 2018 14:40 Go to previous messageGo to next message
MG Gharib is currently offline MG GharibFriend
Messages: 30
Registered: September 2014
Member
Hi Ed,

Sorry for the messing information, Yes I'm using Papyrus - Oxygen. No I didn't use "OCL Xtext Console", I will check.

I have already checked many online resources including the link you have included. One of the problems is that I couldn't find a good resource that I can rely on to better learn and deal with OCL. If you know any good resource, please let me know.

Last year I experienced a problem with OCL, which I couldn't solve by myself. Therefore, I post it here and the guys were very helpful and assist me to solve it. That is why I though about posting this problem here after running out of solution.

Thanks

Re: OCL constraints on some properties of a dependency stereotype [message #1787099 is a reply to message #1787080] Fri, 18 May 2018 17:31 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Yes. We can help you with problem, but only when you adequately explain them.

(The official OMG documentation on OCL navigation involving stereotypes is one not very helpful example in the UML specification.)

Regards

Ed Willink
Previous Topic:detect the constraints conflict
Next Topic:OCL in Activity Diagram
Goto Forum:
  


Current Time: Fri Apr 26 07:35:15 GMT 2024

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

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

Back to the top