<br><br><div class="gmail_quote">2011/3/25 Swindells, Thomas <span dir="ltr">&lt;<a href="mailto:TSwindells@nds.com">TSwindells@nds.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">






<div link="blue" vlink="purple" lang="EN-GB">
<div>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">I thought from was effectively typeless (as it’s operating against a List it can’t always know the type of the members anyway) and so it allows any type on
 teh left – giving a runtime class cast exception if it can’t do the conversion. Therefore if you know they type you are expecting you can still use it on the LHS with whatever constraints you want?</span></p></div></div>
</blockquote><div><br>Sure, &quot;from&quot; doesn&#39;t care what it produces, but accumulate functions have to return an object of some type. Currently. min and max return java.lang.Double; therefore you can use java.lang.Number as a portmanteau type. If min and max should include Data (and all other Comparable&#39;s), the actual result type will have to be Comparable (or Object).<br>
<br>-W<br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div link="blue" vlink="purple" lang="EN-GB"><div>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Thomas</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<div style="border-style: none none none solid; border-color: -moz-use-text-color -moz-use-text-color -moz-use-text-color blue; border-width: medium medium medium 1.5pt; padding: 0cm 0cm 0cm 4pt;">
<div>
<div style="border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; border-width: 1pt medium medium; padding: 3pt 0cm 0cm;">
<p class="MsoNormal"><b><span style="font-size: 10pt;" lang="EN-US">From:</span></b><span style="font-size: 10pt;" lang="EN-US"> <a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank">rules-users-bounces@lists.jboss.org</a> [mailto:<a href="mailto:rules-users-bounces@lists.jboss.org" target="_blank">rules-users-bounces@lists.jboss.org</a>]
<b>On Behalf Of </b>Wolfgang Laun<br>
<b>Sent:</b> 25 March 2011 09:23<br>
<b>To:</b> Rules Users List<br>
<b>Subject:</b> Re: [rules-users] accumulate min over java.util.Date</span></p>
</div>
</div>
<p class="MsoNormal"> </p>
<p class="MsoNormal" style="margin-bottom: 12pt;">Now don&#39;t be hasty with a JIRA. Using Comparable for the arguments of the min and max accumulate functions will give you a result that is -- Comparable. So:<br>
<br>
  $min: Comparable() from accumulate( Schedule( $d: date ), min( $d ) )<br>
<br>
OK, this will give you the minimum data, bound to $min, although it won&#39;t let you write any constraint for the &quot;Comparable&quot; result fact. But, what&#39;s worse, it will not let you write<br>
<br>
  $min: Number( intValue &gt; 100 ) from accumulate( X( $y: y ), min( $y ) )<br>
<br>
any more (unless I&#39;m very much mistaken).<br>
<br>
-W<br>
<br>
<br>
</p>
<div>
<p class="MsoNormal">On 25 March 2011 03:56, Greg Barton &lt;<a href="mailto:greg_barton@yahoo.com" target="_blank">greg_barton@yahoo.com</a>&gt; wrote:</p>
<p class="MsoNormal">Well, if it can work that way it should.  I&#39;d say open a JIRA and request that feature.  It works with the &quot;principle of least confusion.&quot; :)</p>
<div>
<p class="MsoNormal"><br>
--- On Thu, 3/24/11, jkrupka &lt;<a href="mailto:jkrupka@gmail.com" target="_blank">jkrupka@gmail.com</a>&gt; wrote:<br>
<br>
&gt; From: jkrupka &lt;<a href="mailto:jkrupka@gmail.com" target="_blank">jkrupka@gmail.com</a>&gt;</p>
</div>
<p class="MsoNormal">&gt; Subject: Re: [rules-users] accumulate min over java.util.Date</p>
<div>
<p class="MsoNormal">&gt; To: <a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a></p>
</div>
<p class="MsoNormal">&gt; Date: Thursday, March 24, 2011, 8:26 PM</p>
<div>
<div>
<p class="MsoNormal">&gt; Yea the docs weren&#39;t really clear<br>
&gt; about it, so I just thought it would work<br>
&gt; for anything that implemented Comparable =)<br>
&gt;<br>
&gt; Yep, used the long from getTime() - not the prettiest way<br>
&gt; of doing it, but<br>
&gt; it works great.<br>
&gt;<br>
&gt; Thanks!<br>
&gt;<br>
&gt; --<br>
&gt; View this message in context: <a href="http://drools-java-rules-engine.46999.n3.nabble.com/accumulate-min-over-java-util-Date-tp2726081p2728477.html" target="_blank">
http://drools-java-rules-engine.46999.n3.nabble.com/accumulate-min-over-java-util-Date-tp2726081p2728477.html</a><br>
&gt; Sent from the Drools - User mailing list archive at<br>
&gt; Nabble.com.<br>
&gt; _______________________________________________<br>
&gt; rules-users mailing list<br>
&gt; <a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">
https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
&gt;<br>
<br>
<br>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a></p>
</div>
</div>
</div>
<p class="MsoNormal"> </p>
</div>
</div>
<br>
<hr>
<font color="Gray" face="Arial" size="1"><br>
**************************************************************************************<br>
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the <a href="mailto:postmaster@nds.com" target="_blank">postmaster@nds.com</a> and delete it from your system as well as any copies. The content of e-mails as well as traffic data
 may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary.<br>
<br>
NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00<br>
**************************************************************************************<br>
</font>
</div>

<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br>