[rules-users] Another problem

Natraj Gudla natraj.forums at gmail.com
Wed Jul 18 06:11:17 EDT 2007


Hi, I am using Drools 3.0.6, and facing a peculiar problem.

My rule:

*

rule* "Calculate Business profit,1"*
**salience* 1000

*when

**EMIAgainstProperty ( BP1 : refBP1 )
*emi : EMIAgainstProperty ( businessProfit2 > BP1 )

*then* *
*System.out.println(" BP "+(emi.getBusinessProfit1
()+emi.getBusinessProfit2())/2);*
*emi.setBusinessProfit((emi.getBusinessProfit1
()+emi.getBusinessProfit2())/2);*
**end*

**

The above line in bold inside the condition part seem to create problem for
rule evaluation. WHen i have this, the rule does not show up in the Agenda
view, hence i dont see the console print in the action part. As soon as i
remove this line and replace BP1 with 1.5 in the second line, i see the rule
being fired.

As far as i understand, I am doing a declaration to set refBP1 an object
attribute to BP1, which i later use.What is that i am missing here? My fact
has proper getter and setters for refBP1 attribute.



Thanks

Natraj
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20070718/1d82bbb7/attachment.html 


More information about the rules-users mailing list