[gme-users] OCL Question

Raub, Ryan W (FMSCOE) Ryan.Raub at Honeywell.com
Mon Aug 7 13:51:59 CDT 2006


It makes more sense to loop through the connections.  However I am
getting a Syntax error with the "meta::B", I am not sure what that
defines.

 

What is Meta::B ?

 

Thanks,

  Ryan

 

________________________________

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 02, 2006 11:15 AM
To: gme-users
Subject: RE: [gme-users] OCL Question

 

To keep with your example, you need to edit your definition of dest:

Let dest =
self.connectedFCOs("dst")->theOnly().oclAsType(meta::WhateverTheTypeIs).
DataType.trim() in

But I don't recommend using theOnly because if one atom connects to zero
or more than one other atoms it returns undefined. I also don't think
you need to use trim(). For the metamodel fragment in the image, I would
write the constraint:

self.connectedFCOs(meta::Conn)->forAll(other : meta::B | self.DataType =
other.DataType)

The context of the constraint is the 'A' type. Flag the constraint to be
checked on connect.

From: gme-users-bounces at list.isis.vanderbilt.edu
[mailto:gme-users-bounces at list.isis.vanderbilt.edu] On Behalf Of Raub,
Ryan W (FMSCOE)
Sent: Tuesday, August 01, 2006 4:42 PM
To: gme-users
Subject: [gme-users] OCL Question

I am trying to write a constraint to compare a common attribute on two
atoms that are connected, to allow or disallow the connection. 

I have not been able to access the 2nd connecting atom's attribute.  The
source atom can be referred to as "self", but I can not find any method
combination that leads me to the destination atom.  

So far this is what I have:

-- DataType is the name of the string attribute I wish to compare on
both SRC and DST atoms. 

let dest = self.connectedFCOs("dst")->theOnly() in  

let src   = self.DataType.trim() in

dest = src

 

Thanks,

  Ryan 

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


More information about the gme-users mailing list