[rules-users] Calling a function from When part

Wolfgang Laun wolfgang.laun at gmail.com
Fri Aug 3 05:04:39 EDT 2012


Basically this goes like so:

global EmployeeTable empTable;

rule "are all >30 in the table"
when
     Polo( $empNos: employeesNo )  // assuming List<Integer> employeesNo
     not $empNo: Integer( eval( ! empTable.contains( $empNo )  )  ) from $empNo
then
     System.out.println( "all > 30 are in the table" );
end

-W



On 03/08/2012, RulesUsers <agrawalmanisha26 at gmail.com> wrote:
> Hi laune,
>
> Ok let me state you my req,
>
> In my pojo I populate a list of employeesNo that have age > 30, by firing a
> query on my Employee *metadata* tables of company say ABC.
>
> Then I come to the rules & try to see if the company name is ABC?
> If yes, i need to fetch all the employeeNo having age>30 from the Employee
> *Runtime* table( This table stores records for all employees working today
> ), in this way i will come to know if all employees above age 30 are
> present
> or not.
>
> Regards,
> Sam
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/Calling-a-function-from-When-part-tp4018987p4019010.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>


More information about the rules-users mailing list