<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<title>RE: [gme-users] OCL Question</title>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="PersonName"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
p
        {mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=blue>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>It makes more sense to loop through the
connections.&nbsp; However I am getting a Syntax error with the &#8220;meta::B&#8221;,
I am not sure what that defines.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>What is Meta::B ?<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Thanks,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp; Ryan<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
gme-users-bounces@list.isis.vanderbilt.edu [mailto:gme-users-bounces@list.isis.vanderbilt.edu]
<b><span style='font-weight:bold'>On Behalf Of </span></b>Matthew J. Emerson<br>
<b><span style='font-weight:bold'>Sent:</span></b> Wednesday, August 02, 2006
11:15 AM<br>
<b><span style='font-weight:bold'>To:</span></b> gme-users<br>
<b><span style='font-weight:bold'>Subject:</span></b> RE: [gme-users] OCL
Question</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p><font size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:
Arial;color:navy'>To keep with your example, you need to edit your definition
of dest:</span></font><o:p></o:p></p>

<p><font size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:
Arial;color:navy'>Let dest =
self.connectedFCOs(&#8220;dst&#8221;)-&gt;theOnly().oclAsType(meta::WhateverTheTypeIs).DataType.trim()
in</span></font><o:p></o:p></p>

<p><font size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:
Arial;color:navy'>But I don&#8217;t recommend using theOnly because if one atom
connects to zero or more than one other</span></font> <font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>atoms it
returns undefined.</span></font> <font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy'>I also don&#8217;t think
you need to use trim(). For the metamodel fragment in the image, I would write
the constraint:</span></font><o:p></o:p></p>

<p><font size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:
Arial;color:navy'>self.connectedFCOs(meta::Conn)-&gt;forAll(other : meta::B |
self.DataType = other.DataType)</span></font><o:p></o:p></p>

<p><font size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:
Arial;color:navy'>The context of the constraint is the</span></font> <font
size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:navy'>&#8216;A&#8217; type. Flag the constraint to be checked on connect.</span></font><o:p></o:p></p>

<p><b><font size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma;
font-weight:bold'>From:</span></font></b><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma'>
gme-users-bounces@list.isis.vanderbilt.edu [<a
href="mailto:gme-users-bounces@list.isis.vanderbilt.edu">mailto:gme-users-bounces@list.isis.vanderbilt.edu</a>]</span></font><b><span
style='font-weight:bold'> </span></b><b><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma;font-weight:bold'>On Behalf Of</span></font></b>
<st1:PersonName w:st="on"><font size=2 face=Tahoma><span style='font-size:10.0pt;
 font-family:Tahoma'>Raub, Ryan W</span></font></st1:PersonName><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> (FMSCOE)<br>
<b><span style='font-weight:bold'>Sent:</span></b> Tuesday, August 01, 2006
4:42 PM<br>
<b><span style='font-weight:bold'>To:</span></b> gme-users<br>
<b><span style='font-weight:bold'>Subject:</span></b> [gme-users] OCL Question</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>I
am trying to write a constraint to compare a common attribute on two atoms that
are connected, to allow or disallow the connection.</span></font> <o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>I
have not been able to access the 2<sup>nd</sup> connecting atom&#8217;s
attribute.&nbsp; The source atom can be referred to as &#8220;self&#8221;, but
I can not find any method combination that leads me to the destination
atom.&nbsp; </span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>So
far this is what I have:</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>--
DataType is the name of the string attribute I wish to compare on both SRC and
DST atoms. </span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>let
dest = self.connectedFCOs(&quot;dst&quot;)-&gt;theOnly() in &nbsp;</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>let
src&nbsp;&nbsp; = self.DataType.trim() in</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>dest
= src</span></font><o:p></o:p></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>Thanks,</span></font><o:p></o:p></p>

<p><font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>&nbsp;
Ryan</span></font> <o:p></o:p></p>

</div>

</body>

</html>