<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>Message</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:purple;
        text-decoration:underline;}
span.EmailStyle17
        {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>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

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

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>The constraint manager is really just
another GME Add-On (event-driven model interpreter). You could write your own
small Add-On to monitor for this one even event for your language and disallow
in the same way the constraint manager would without writing an actual
constraint that would get checked on &#8220;Check All&#8221;.<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'>Or, you could use GME type-instancing. You
could define a container with the appropriate number of children &#8220;off to
the side&#8221;, and then in your actual model on use instances of the
container. The instances would be read-only, so the number of children could
not change.<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'>You may also be able to use the
multiplicity of the composition connection if all instances of the container
type are supposed to contain the same static number of children.<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'>The only way to make what you describe
work with an OCL constraint, though, is by using some piece of state that
persists longer than the evaluation of the constraint. For example, an
attribute on the Container that gives the number of children it should hold.<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'>--Matt<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'> <st1:PersonName
w:st="on">gme-users</st1:PersonName>-bounces@list.isis.vanderbilt.edu [mailto:<st1:PersonName
w:st="on">gme-users</st1:PersonName>-bounces@list.isis.vanderbilt.edu] <b><span
style='font-weight:bold'>On Behalf Of </span></b>Larry H.<br>
<b><span style='font-weight:bold'>Sent:</span></b> Thursday, March 02, 2006
10:32 AM<br>
<b><span style='font-weight:bold'>To:</span></b> <st1:PersonName w:st="on">gme-users</st1:PersonName><br>
<b><span style='font-weight:bold'>Subject:</span></b> [<st1:PersonName w:st="on">gme-users</st1:PersonName>]
Constraint problem</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>

<div>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>I'm having a problem defining a constraint that concerns a
change in number of children&nbsp;in a container.&nbsp; My intention is to
check this&nbsp;constraint on an event, like &quot;onlostchild&quot;, and to
prevent the action by setting the constraint's Priority=1.&nbsp; My problem is
to find an approach that does not subsequently trigger a violation when the
user chooses the 'Check All' action of the Constraint Manager.</span></font><o:p></o:p></p>

</div>

<div>

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

</div>

<div>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>It is my current belief that there is no way to define such
a constraint.&nbsp; The reason is that the focus of this&nbsp;constraint is
&quot;change&quot;, whereas the focus of the Constraint Manager, in general, is
&quot;current
state&quot;.&nbsp;&nbsp;&nbsp;Constraints&nbsp;concerning&nbsp;&quot;change&quot;
typically involve knowing &quot;state before&quot; and &quot;state
after&quot;.&nbsp; Have I&nbsp;failed to consider something?</span></font><o:p></o:p></p>

</div>

<div>

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

</div>

<div>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>One thing that occurs to me is that the Constraint Manager
might consider not checking constraints on &quot;Check All&quot; that are
checked on events with Priority=1.&nbsp; The intuition is that, since such
event-based constraints can only result in aborting the action, there is simply
no reason to check them again on &quot;Check All&quot;.&nbsp; Such a feature
would allow the desired constraint to be defined quite simply with a
&quot;false&quot; predicate.</span></font><o:p></o:p></p>

</div>

<div>

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

</div>

</div>

</body>

</html>