That's why I wrote "don't be hasty" ;-)<br><br>accumulate is generic right now: You can code the steps explicitly, or you can plug in your own accumulate function. Writing "lower" and "upper" for Comparable (or Date) is a matter of 100 LOC each.<br>
<br>-W<br><br><br><br><div class="gmail_quote">2011/3/25 Greg Barton <span dir="ltr"><<a href="mailto:greg_barton@yahoo.com">greg_barton@yahoo.com</a>></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 bgcolor="#FFFFFF"><div>Which is why I prefaced with "if it can work that way..." A JIRA can be for feature requests, and that's what this would be. Whether just adding a Comparable based accumulate function is the solution, or making accumulate generic like "from" is now, a JIRA does not have to specify the solution, just the request.<br>
<br>GreG</div><div><br>On Mar 25, 2011, at 4:22, Wolfgang Laun <<a href="mailto:wolfgang.laun@gmail.com" target="_blank">wolfgang.laun@gmail.com</a>> wrote:<br><br></div><div></div><blockquote type="cite"><div>Now don'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:<div class="im">
<br><br> $min: Comparable() from accumulate( Schedule( $d: date ), min( $d ) )<br>
<br></div>OK, this will give you the minimum data, bound to $min, although it won't let you write any constraint for the "Comparable" result fact. But, what's worse, it will not let you write<br><br> $min: Number( intValue > 100 ) from accumulate( X( $y: y ), min( $y ) )<div class="im">
<br>
<br>any more (unless I'm very much mistaken).<br><br></div>-W<br><br><br><br><div class="gmail_quote"><div class="im">On 25 March 2011 03:56, Greg Barton <span dir="ltr"><<a href="mailto:greg_barton@yahoo.com" target="_blank"></a><a href="mailto:greg_barton@yahoo.com" target="_blank">greg_barton@yahoo.com</a>></span> wrote:<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 class="im">Well, if it can work that way it should. I'd say open a JIRA and request that feature. It works with the "principle of least confusion." :)<br>
<div><br>
--- On Thu, 3/24/11, jkrupka <<a href="mailto:jkrupka@gmail.com" target="_blank"></a><a href="mailto:jkrupka@gmail.com" target="_blank">jkrupka@gmail.com</a>> wrote:<br>
<br>
> From: jkrupka <<a href="mailto:jkrupka@gmail.com" target="_blank"></a><a href="mailto:jkrupka@gmail.com" target="_blank">jkrupka@gmail.com</a>><br>
</div></div><div class="im">> Subject: Re: [rules-users] accumulate min over java.util.Date<br>
</div><div class="im"><div>> To: <a href="mailto:rules-users@lists.jboss.org" target="_blank"></a><a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
</div></div><div class="im">> Date: Thursday, March 24, 2011, 8:26 PM<br>
</div><div><div></div><div><div class="im">> Yea the docs weren't really clear<br></div><div class="im">
> about it, so I just thought it would work<br></div><div class="im">
> for anything that implemented Comparable =)<br>
><br></div><div class="im">
> Yep, used the long from getTime() - not the prettiest way<br></div><div class="im">
> of doing it, but<br>
> it works great.<br>
><br>
> Thanks!<br>
><br>
> --<br></div>
> 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"></a><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><div class="im">
<br>
> Sent from the Drools - User mailing list archive at<br>
> <a href="http://Nabble.com" target="_blank">Nabble.com</a>.<br>
> _______________________________________________<br>
> rules-users mailing list<br>
> <a href="mailto:rules-users@lists.jboss.org" target="_blank"></a><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"></a><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
><br>
<br>
<br>
<br></div><div class="im">
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank"></a><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"></a><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</div></div></div></blockquote></div><br>
</div></blockquote><div class="im"><blockquote type="cite"><div><span>_______________________________________________</span><br><span>rules-users mailing list</span><br><span><a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a></span><br>
<span><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a></span><br></div></blockquote></div></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>