Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » How to use embedded OCL constraints from ecore in Sirius?
How to use embedded OCL constraints from ecore in Sirius? [message #1765481] Sat, 10 June 2017 16:51 Go to next message
Jonas Sorgalla is currently offline Jonas SorgallaFriend
Messages: 10
Registered: September 2015
Location: Dortmund, Germany
Junior Member
Hi sirius-community,

I am currently developing my first graphical editor with sirius and so far my experience has been great! Sirius feels very comfortable to use and I am sure I have just scrached the surface of all the cool stuff possible with Sirius.

However, yesterday I encountered an issue which I can't figure out by myself:

I have an ecore Model with embedded OCL as you can see in the picture. The constraints work perfectly when create a Dynamic Instance from the ecore-File.
Sadly it seems like my Sirius-Viewpoint-Project is ignoring the constraints. In the tutorial I've read that it is possible to describe constraints with aql directly in the odesign-file. However, my ecore-metamodel is used by multiple editors and it would be perfect to just rely on the embedded OCL rather than redundantly copy-paste them into the sirius aql. Is there a way to enable the constraints from ecore on the sirius odesign level?

Thanks for your help and greetings from a german sirius novice

Jonas

Re: How to use embedded OCL constraints from ecore in Sirius? [message #1765499 is a reply to message #1765481] Sun, 11 June 2017 08:28 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

I think it should just work. Possibly not live, so you might need to use Validate explicitly. You could try OCL->Validate, since that picks up what the UML Model Editor and GenModel Editor decline to do. Perhaps even restart and validate.You could try the alternate Pivot/LPG OCL delegate evaluator since they have different allInstances; possibly one approach is validating an empty allInstances.

I suggest you create a repro and submit a Bugzilla.

(Style note: an allInstances based constraint per element incurs quadratic costs. Better to get the parent object to forAll/isUnique its children just once.)

Regards

Ed Willink
Re: How to use embedded OCL constraints from ecore in Sirius? [message #1765557 is a reply to message #1765499] Mon, 12 June 2017 12:58 Go to previous messageGo to next message
Jonas Sorgalla is currently offline Jonas SorgallaFriend
Messages: 10
Registered: September 2015
Location: Dortmund, Germany
Junior Member
Hi Ed,

thanks for your reply. As it turned out I was to dumb to find the right validate button :)
It works! Thanks!
Re: How to use embedded OCL constraints from ecore in Sirius? [message #1765573 is a reply to message #1765557] Mon, 12 June 2017 14:06 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Which Validate did you need? OCL->Validate should not be necessary; it is a workaround for deficient tooling that replaces rather than extends the standard EValidator protocol.

Regards

Ed Willink

Previous Topic:Relation or Element Based Edge: Possible without target?
Next Topic:Change context programmatically
Goto Forum:
  


Current Time: Thu Apr 25 07:45:55 GMT 2024

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

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

Back to the top