You can use a collect statement to get all of the Job objects.

  $list : ArrayList() from collect ( Job() )

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

  $shortest : Job ( $min : min)
  not Job(min < $min)
  go go go!

Hope this helps!

Steve Ronderos

From: kothvandir kothvandir <>
Date: 08/31/2009 01:35 PM
Subject: [rules-users] Calculating minimal value for a group of facts
Sent by:


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.

Is there any way to obtain within a rule the current facts of some type to pass then to a function/method? 
somethin like this:

Another idea to acomplish this?

gobal MyService myservice

rule "cmdCheckTime" ruleflow-group "comprobarExistencias"
Job(time = eval(myService.getMinTime( <jobs in working memory >))
go, go, go...


Thank you_______________________________________________
rules-users mailing list