Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Constraint reference contents in a subtype
Constraint reference contents in a subtype [message #1196597] Tue, 19 November 2013 13:47 Go to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 295
Registered: March 2012
Senior Member
Hi,

Can I do this with EMF/OCL (Sorry for the stupid example :))?


Animal
-children [0-*] : Animal

Dog -> Animal
Cat -> Animal

I now would like to define a constraint on Dog, such that a dog's
children may only be dogs and a Cat's chidren well.. you guess.

The constraint would be defined on a different type than the feature
that is being constraint.

I also thought to use maybe this:
http://ed-merks.blogspot.it/2013/01/emf-can-do-what.html which serves a
similar purpose.

Thanks,
Felix
Re: Constraint reference contents in a subtype [message #1196882 is a reply to message #1196597] Tue, 19 November 2013 16:45 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Yes.

On 19/11/2013 13:47, Felix Dorner wrote:
> Hi,
>
> Can I do this with EMF/OCL (Sorry for the stupid example :))?
>
>
> Animal
> -children [0-*] : Animal
>
> Dog -> Animal
> Cat -> Animal
>
> I now would like to define a constraint on Dog, such that a dog's
> children may only be dogs and a Cat's chidren well.. you guess.
>
> The constraint would be defined on a different type than the feature
> that is being constraint.
>
> I also thought to use maybe this:
> http://ed-merks.blogspot.it/2013/01/emf-can-do-what.html which serves
> a similar purpose.
>
> Thanks,
> Felix
Previous Topic:OCL invariants in ecore file doesn't work reliable
Next Topic:"misplaced contructs" using second import statement
Goto Forum:
  


Current Time: Thu Apr 25 00:10:34 GMT 2024

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

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

Back to the top