[rules-users] function compilation error

JLL jll at labocollard.be
Tue Apr 17 06:09:29 EDT 2007


hi all

I've to following error when using one of my drl
Can't i use more than one param in the function call ?
thanks 

JLL

javax.ejb.EJBTransactionRolledbackException:
org.drools.rule.InvalidRulePackage: Function Compilation error
Rule Compilation error The method getMin(PrestationFacturable,
PrestationFacturable) in the type GetMin is not applicable for the arguments
(PrestationFacturable, FactHandle)

the drl file is the folowing

package be.labocollard.server.rules ;

import be.labocollard.server.entities.PrestationFacturable;
import be.labocollard.server.entities.Prestation;

function PrestationFacturable getMin(PrestationFacturable pf1,
PrestationFacturable pf2) {
 if (pf1.getPrestation().getNombreB() > pf2.getPrestation().getNombreB())
return pf1;
 else return pf2;
}

rule "cumul_1"
   when
       $pf1 : PrestationFacturable( $p1 : prestation ->
($p1.getCodePrestation().equals("120153") ||
$p1.getCodePrestation().equals("120175") ||
$p1.getCodePrestation().equals("120190")))
       $pf2 : PrestationFacturable( $p2 : prestation ->
($p2.getCodePrestation().equals("120050") ||
$p2.getCodePrestation().equals("120514")))
         then
       retract(getMin($pf1, $pf2));
   end
   

-- 
View this message in context: http://www.nabble.com/function-compilation-error-tf3589880.html#a10032557
Sent from the drools - user mailing list archive at Nabble.com.




More information about the rules-users mailing list