<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:m="http://schemas.microsoft.com/office/2004/12/omml" 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 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"Trebuchet MS";
        panose-1:2 11 6 3 2 2 2 2 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
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 style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Trebuchet MS","sans-serif";background:white;mso-highlight:white'>Hello,<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Trebuchet MS","sans-serif";background:white;mso-highlight:white'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Trebuchet MS","sans-serif";background:white;mso-highlight:white'>I
am trying to achieve something like a SQL statement equivalent of:<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Trebuchet MS","sans-serif";background:white;mso-highlight:white'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New";
background:white;mso-highlight:white'>SELECT &nbsp;&nbsp;&nbsp;r.property1 AS
p1, r.property2 AS p2, SOME_CALCULATION(r.property3) AS p3<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New";
background:white;mso-highlight:white'>FROM &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;right AS
r<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New";
background:white;mso-highlight:white'>GROUP BY &nbsp;p2, p3<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Trebuchet MS","sans-serif";background:white;mso-highlight:white'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Trebuchet MS","sans-serif";background:white;mso-highlight:white'>I
am not sure if this is valid SQL since I am grouping by a calculated value, but
that aside. <o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Trebuchet MS","sans-serif";background:white;mso-highlight:white'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Trebuchet MS","sans-serif";background:white;mso-highlight:white'>I
am asserting the Rights objects into the working memory and then would like to
execute a rule on the objects based <o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Trebuchet MS","sans-serif";background:white;mso-highlight:white'>on
a grouping of objects. The first property is directly accessible from the
object </span><b><span style='font-family:"Courier New";background:white;
mso-highlight:white'>right.getProperty2()</span></b><span style='font-size:
10.0pt;font-family:"Trebuchet MS","sans-serif";background:white;mso-highlight:
white'> but the <o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Trebuchet MS","sans-serif";background:white;mso-highlight:white'>second
property is only accessible through a lookup </span><b><span style='font-family:
"Courier New";background:white;mso-highlight:white'>MyClass.staticMethod(right.getProperty3())</span></b><span
style='font-family:"Courier New";background:white;mso-highlight:white'>.</span><span
style='font-size:10.0pt;font-family:"Courier New";background:white;mso-highlight:
white'> <o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Courier New";background:white;mso-highlight:white'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Trebuchet MS","sans-serif";background:white;mso-highlight:white'>As
far as I have it the rule should make use of something like </span><b><span
style='font-family:"Courier New";background:white;mso-highlight:white'>collect</span></b><span
style='font-size:10.0pt;font-family:"Trebuchet MS","sans-serif";background:
white;mso-highlight:white'> or </span><b><span style='font-family:"Courier New";
background:white;mso-highlight:white'>accumulate</span></b><span
style='font-size:10.0pt;font-family:"Trebuchet MS","sans-serif";background:
white;mso-highlight:white'> but I do not know how to <o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Trebuchet MS","sans-serif";background:white;mso-highlight:white'>achieve
this without also asserting the properties objects into the memory as well. And
even if I assert the properties<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Trebuchet MS","sans-serif";background:white;mso-highlight:white'>objects
into the working memory I do not know how to group by the second property.<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"Trebuchet MS","sans-serif";background:white;mso-highlight:white'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New";
background:white;mso-highlight:white'>rule &quot;Calculate something&quot;</span><span
style='font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New";
background:white;mso-highlight:white'>&nbsp;&nbsp;&nbsp;&nbsp; no-loop</span><span
style='font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New";
background:white;mso-highlight:white'>&nbsp;&nbsp;&nbsp;&nbsp; when</span><span
style='font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New";
background:white;mso-highlight:white'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $rights:
ArrayList( ) </span><span style='font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New";
background:white;mso-highlight:white'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
from collect( Right( ) );</span><span style='font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New";
background:white;mso-highlight:white'>&nbsp;&nbsp;&nbsp;&nbsp; then</span><span
style='font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New";
background:white;mso-highlight:white'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span
style='font-family:"Courier New"'>// execute rule<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-family:"Courier New";
background:white;mso-highlight:white'>end</span><span style='font-family:"Courier New"'><o:p></o:p></span></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Trebuchet MS","sans-serif"'>Could
you please give me some assistance?<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Trebuchet MS","sans-serif"'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Trebuchet MS","sans-serif"'>Regards<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Trebuchet MS","sans-serif"'>Juan<o:p></o:p></span></p>

</div>

</body>

</html>

<table><tr><td bgcolor=#ffffff><font color=#000000>"Employees of Lonmin Platinum ("Lonplats") are not authorised to conclude<br>
electronic transactions or to enter into electronic agreements on behalf<br>
of Lonplats. Any electronic signature (other than an advanced electronic<br>
signature as defined in the Electronic Communications and Transactions<br>
Act of 2003) added to a data message (such as an email or an attachment<br>
to an (email) ostensibly on behalf of Lonplats by a Lonplats employee shall<br>
not be legally binding on Lonplats and Lonplats shall incur no liability of<br>
any nature whatsoever, directly or indirectly, arising from such act on the<br>
part of it's employee. It is further recorded that nothing (other than an<br>
advanced electronic signature) inserted into any data message<br>
emanating from Lonplats shall be construed as constituting an electronic<br>
signature"<br>
</font></td></tr></table>