[rules-users] Possible problem in PathMemory

rjh raojinghai at gmail.com
Thu Jun 12 14:03:29 EDT 2014


Hello,

I developed a system where dynamic salience for some particular rules
doesn't rules. However, it is very hard for me to create a simple test case
unless I publish the entire rule files. In the system, some rules using
dynamic salience work and some don't, but I don't know why.

I debugged into the drools-core source code, and found out the following
code in branch 6.0.x.
(https://github.com/droolsjbpm/drools/blob/6.0.x/drools-core/src/main/java/org/drools/core/reteoo/PathMemory.java)

Line 98 - org.drools.core.reteoo.PathMemory::doLinkRule

            int salience = ( rtn.getRule().getSalience() instanceof
MVELSalienceExpression)
                           ? 0
                           : rtn.getRule().getSalience().getValue(null,
rtn.getRule(), wm);

Line 113 - org.drools.core.reteoo.PathMemory::doUnlinkRule

            int salience = ( rtn.getRule().getSalience() instanceof
MVELSalienceExpression)
                           ? 0
                           : rtn.getRule().getSalience().getValue(null,
rtn.getRule(), wm);

I wonder if this is a bug that put the first value and the second value
reversed. At least I fixed my problem after reversing them. 

Thanks.

Jinghai 




--
View this message in context: http://drools.46999.n3.nabble.com/Possible-problem-in-PathMemory-tp4030026.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list