[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.modeling.gmf] Re: GMF mapping Audit Rules
|
- From: aachila@xxxxxxxxxxx (Achilleas )
- Date: Wed, 4 Feb 2009 13:42:46 +0000 (UTC)
- Newsgroups: eclipse.modeling.gmf
- Organization: Eclipse
- User-agent: NewsPortal/0.36 (http://florian-amrhein.de/newsportal)
Hi Christian,
I did it as follows:
context Class1:
inv:
Root.allInstances()->forAll(e | e.classes2->exists(c | c.value = self.value))
But i believe both of your ways are better!
I thought that only for the Root class we can use the allInstances() when
the context (domain element target) is set to another class.
Your 2nd example is even more expressive and resolves the problem I have,
where the error is depicted on all instances of the element,e.g. when i
impose the constraint:
context Class:
inv:
Class.allInstances()->forAll( c1, c2 | c1 <> c2 implies c1.id <> c2.id )
This produces an error that appears on all instances. I believe with your
2nd constraint this is contained only to the two specific instances that
have the same "id"??? Anyway I will try it out to see if that's the case!
Thanks,
Achilleas