Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Papyrus » Define general OCL Constraints
Define general OCL Constraints [message #1441860] Fri, 10 October 2014 09:30 Go to next message
van Thinh Le is currently offline van Thinh LeFriend
Messages: 2
Registered: October 2014
Junior Member
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 20:42]

Report message to a moderator

Re: Define general OCL Constraints [message #1443945 is a reply to message #1441860] Mon, 13 October 2014 12:41 Go to previous message
Ronan B is currently offline Ronan BFriend
Messages: 273
Registered: July 2009
Senior Member
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 Apr 25 22:17:25 GMT 2024

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

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

Back to the top