Skip to main content



      Home
Home » Modeling » Papyrus » Define general OCL Constraints
Define general OCL Constraints [message #1441860] Fri, 10 October 2014 05:30 Go to next message
Eclipse UserFriend
Hello everyone,
I use Eclipse Luna with Papyrus 1.0. I'm new to OCL and have troubles defining general constraints in the Papyrus diagram.
Can someone recommend a good Papyrus OCL tutorial or examples which embrace more complicated constraints than in the Eclipse documentation?

I want to specify constraints like this, is it even possible with OCL?
- All properties / operations / parameters must have a name
- A specific stereotype must use at least once and not more than once in a diagram
- An operation have not more than 1 return type parameter. I tried this in my profile, but it doesn't work. Any ideas why?
self.base_Operation.ownedParameter->select(direction = ParameterDirectionKind::return)->size() < 2

Regards
Le

[Updated on: Sun, 12 October 2014 16:42] by Moderator

Re: Define general OCL Constraints [message #1443945 is a reply to message #1441860] Mon, 13 October 2014 08:41 Go to previous message
Eclipse UserFriend
Hi,
Assuming your defining your OCL in a Profile then what you want to do is possible. The OCL you have specified in the post is not valid so that why it does not work. Are you using the super cool OCL editor built into Papyrus?

Read http://help.eclipse.org/luna/index.jsp?topic=%2Forg.eclipse.ocl.doc%2Fhelp%2FOCLinPapyrus.html and http://wiki.eclipse.org/Papyrus/UserGuide/Profile_Constraints

Actually the documentation should really be off the main papyrus page, http://www.eclipse.org/papyrus/usersCorner/usersCornerIndex.php but this isn't the case today. Camille can this be fixed? Right now you can use the F1 help in Eclipse to find all the documentation.

Regards,
Ronan
Previous Topic:Exchange of Papyrus models files
Next Topic:Kepler -> Luna : SysML Reqs Diagram can not load
Goto Forum:
  


Current Time: Thu Jul 03 20:14:41 EDT 2025

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

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

Back to the top