<br><font size=2 face="sans-serif">You can use a collect statement to get
all of the Job objects.</font>
<br>
<br><font size=2 face="sans-serif"> $list : ArrayList() from collect
( Job() )</font>
<br>
<br><font size=2 face="sans-serif">alternatively if all that your service
method call is doing is comparing the values of a field in a list of Job
objects, there are ways to do that without the eval</font>
<br>
<br><font size=2 face="sans-serif">when</font>
<br><font size=2 face="sans-serif"> $shortest : Job ( $min : min)</font>
<br><font size=2 face="sans-serif"> not Job(min < $min)</font>
<br><font size=2 face="sans-serif">then</font>
<br><font size=2 face="sans-serif"> go go go!</font>
<br>
<br><font size=2 face="sans-serif">Hope this helps!</font>
<br><font size=2 face="sans-serif"><br>
</font><font size=3>Steve Ronderos </font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">From:</font>
<td><font size=1 face="sans-serif">kothvandir kothvandir <kothvandir@gmail.com></font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">To:</font>
<td><font size=1 face="sans-serif">rules-users@lists.jboss.org</font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">Date:</font>
<td><font size=1 face="sans-serif">08/31/2009 01:35 PM</font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">Subject:</font>
<td><font size=1 face="sans-serif">[rules-users] Calculating minimal value
for a group of facts</font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">Sent by:</font>
<td><font size=1 face="sans-serif">rules-users-bounces@lists.jboss.org</font></table>
<br>
<hr noshade>
<br>
<br>
<br><font size=3>Hi,</font>
<br>
<br><font size=3>I need to calculate the min time for a set of "jobs"
inserted in working mermory to know wich job is going to be finished first.</font>
<br>
<br><font size=3>Is there any way to obtain within a rule the current facts
of some type to pass then to a function/method? </font>
<br><font size=3>somethin like this:</font>
<br>
<br><font size=3>Another idea to acomplish this?</font>
<br>
<br>
<br><font size=3>gobal MyService myservice</font>
<br>
<br><font size=3>rule "cmdCheckTime" ruleflow-group "comprobarExistencias"</font>
<br><font size=3>when</font>
<br><font size=3>Job(time = eval(myService.getMinTime( <jobs in working
memory >))</font>
<br><font size=3>then </font>
<br><font size=3>go, go, go...</font>
<br>
<br><font size=3>end</font>
<br>
<br><font size=3>Thank you</font><tt><font size=2>_______________________________________________<br>
rules-users mailing list<br>
rules-users@lists.jboss.org<br>
</font></tt><a href="https://lists.jboss.org/mailman/listinfo/rules-users"><tt><font size=2>https://lists.jboss.org/mailman/listinfo/rules-users</font></tt></a><tt><font size=2><br>
</font></tt>
<br>
<br>