[gme-users] Re: Small question and discussion forums
Matthew J. Emerson
mjemerson at isis.vanderbilt.edu
Thu Feb 23 10:12:43 CST 2006
Hi Zawar,
Although GME is supposed to automatically generate and enforce multiplicity-based constraints, I find the error messages given when such constraints are violated to be not-so-user-friendly. So, I prefer to always write an OCL constraint so that I can provide a detailed error message.
The OCL constraint you're looking for it:
self.parts(meta::BaseType)->size < 2
The context of the constraint should be your Any class. The "On new child" trigger should be set to true.
HTH,
Matt
-----Original Message-----
From: gme-users-bounces at list.isis.vanderbilt.edu [mailto:gme-users-bounces at list.isis.vanderbilt.edu] On Behalf Of Akos Ledeczi
Sent: Thursday, February 23, 2006 10:06 AM
To: Zawar Qayyum
Cc: gme-users
Subject: [gme-users] Re: Small question and discussion forums
Zawar,
cc-d is the mailing list you are looking for. Specifying 0..1 should
work, the metainterpreter is supposed to generate the appropriate
constraint. Is that not the case?
Regards,
Akos
Zawar Qayyum wrote:
> Akos
>
> I am using GME as part of my research in modelling an architectural
> definition language Pi-ADL at Université de Bretagne-Sud. I must say
> that its a very robust and well written tool. I have a little question
> however: In my meta model I have a <<Model>> called Any, which can
> contain (through a containment relationship) atmost one instance of
> <<Atom>> BaseType. How do I express that in the subset of OCL that GME
> implements? Customizing the multiplicity doesn't seem to have the
> desired effect since I want to /*prevent*/ the addition of more than one
> BaseTypes.
>
> I would have liked to post this question on a relevant discussion forum
> but didn't find any. Could you point me to any such forum that you know of?
>
> Thanks in advance.
> Zawar
_______________________________________________
gme-users mailing list
gme-users at list.isis.vanderbilt.edu
http://list.isis.vanderbilt.edu/mailman/listinfo/gme-users
More information about the gme-users
mailing list