[gme-users] In OCL, gme::FCO::baseType throws exception

Zoltan Molnar zolmol at isis.vanderbilt.edu
Fri Sep 2 17:25:32 CDT 2005


I checked in mga.idl which says that 
 
interface IMgaFCO : IMgaObject
{
//...
BaseType (fails for all instances; returns NULL if object is not derived
}
 
The ocl method baseType() uses the IMgaFCO.BaseType method.
The ocl method type() uses IMgaFCO.DerivedFrom method, which succeeds
for instances, so this is what you have to use.
 
br,Zoli

-----Original Message-----
From: gme-users-bounces at list.isis.vanderbilt.edu
[mailto:gme-users-bounces at list.isis.vanderbilt.edu] On Behalf Of Matthew
J. Emerson
Sent: Wednesday, August 31, 2005 1:45 PM
To: gme-users
Subject: [gme-users] In OCL, gme::FCO::baseType throws exception



I'm having some problems with the constraint function
gme::FCO::baseType. Any time I use this in a constraint equation, it
throws an exception and returns undefined.

 

For example, I have the constraint:

 

            If(self.isInstance())

                        let base = self.baseType() in

                        let type = self.type() in

                        false

            else

                        true

            endif

 

On one of my model elements as a test. For types, the if-clause
evaluates to false and the constraint does not fail. However, for
instances the constraint checker attempts to find a type and a base
type.

 

The constraint checker has no problem correctly identifying the type of
an instance. However, in all cases (even when I'm checking the
constraint for an instance of an instance of an instance),
self.baseType() throws an exception and returns undefined.  I attached
an example .xme of a metamodel and test model so you can play with it.

 

Is this a bug?

 

I also included a user-defined constraint which accomplishes the
functionality that should be provided by gme::FCO::baseType. Will the
constraint system complain if I just overload the baseType name with my
own function?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.isis.vanderbilt.edu/pipermail/gme-users/attachments/20050902/e109ad34/attachment.htm


More information about the gme-users mailing list