|Re: How to count associative classes in a UML model [message #518653 is a reply to message #518510]
||Thu, 04 March 2010 12:00
| Ed Willink
Registered: July 2009
It's still not clear what you want or what is failing.
An invariant is a statement/expression that is always true of its
context, it is therefore a boolean.
is not boolean
....->size() = 0
Try expressing your intent in semi-formal English.
"It is invariably true that the model does not contain any classes that
are association classes."
Then you may understand the problem you are trying to solve and may then
be able to transliterate it into OCL.
On 04/03/2010 10:42, Gilbert wrote:
> sorry I want to count, want to know is this a correct way to count
> associative class.
> context Model
> inv: allOwnedElements()->select(oclIsTypeOf(Class)->exists(c|c.ownedType
> = oclIsTypeOf(Association))) ->size()
Powered by FUDForum
. Page generated in 0.03685 seconds