[gme-users] accessing attributes in GME constraints

Rajesh Kumar bradkumar at gmail.com
Mon Jun 18 10:38:05 CDT 2007


Hi guys,

I am trying to define some simple constraints in GME and I am confused
about how to access attributes of entities.

I have a "Connection" object which connects a FCO called
"NetInterface" and an Atom (called "Port" in the model). "Port" is a
subclass of "NetInterface". "NetInterface" has a string attribute
called "att_protocol_name"

I want to specify the constraint that "in a connection both ends must
have the same protocol name"

I create a constraint in the constraints aspect and attach it to the
Connection object of interest. Now I try to specify the constraint as
follows:

self.connectionPoints("src")->theOnly().target().att_protocol_name =
self.connectionPoints("dst")->theOnly().target().att_protocol_name

-- This gives an error saying that Attribute
[gme::FCO::att_protocol_name] does not exist

I have looked through the manual and everything but I cannot figure
this out. Can anyone help me out here?

Rajesh


More information about the gme-users mailing list