I changed the rules to the following so I will test and see:

rule "Add Baseline to Context if it does not exists exists or not greater
then 0" 
        no-loop true 
        when 
                $context:Context($id:id,baselineParticipation==null || 
                                  
baselineParticipation.baselineRatio==null||baselineParticipation.baselineRatio==0)
 
        then 
                modify($firm) {setBaselineParticipation(new
BaselineParticipation($id,new BigDecimal(0.00485)))}; 
                
end 

rule "Calculate Participation Ratio" 
        no-loop true 
        when 
               
$context:Context(consolidatdVolume!=null,consolidatdVolume.avgVolume!=0, 
                                  
volumeAccumulations["total"]!=null,volumeAccumulations["total"]!=0, 
                                                                  
$total:volumeAccumulations["total"],$avg:consolidatdVolume.avgVolume) 
        then 
                ConcurrentMap calculatedRatios=$firm.getCalculatedRatios(); 
                calculatedRatios.put("participationRatio",new
BigDecimal($total/$avg)); 
                modify($firm){setCalculatedRatios(calculatedRatios)}; 
end 



--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools-5-5-divide-by-0-exception-tp4026582p4026589.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to