[rules-users] How is this possible?

Axelrod, Nelson naxelrod at jcvi.org
Tue Jul 6 11:28:51 EDT 2010


Hi,

We're having some troubling problems that can be best explained by the
following two rules.  Based on the facts inserted into the stateful
knowledge session, we expected both rules to fire for an Hmm Hit to
TIGR00549, but only the "Test" rule fires.  Can anyone explain how this
could possibly occur?  There are no other rules added to the knowledge
base.  This was tested using Drools 5.0 on Windows XP and Linux
environments.

 

rule "HMM Hit"

      when

            hit : HmmHit( aboveTrustedHit == true )

            p     : FeatureProperty( id == hit.hitId )

            f     : Feature ( featureId == hit.queryId, properties not
contains p )

      then

            if (hit.getHitId().equals("TIGR00549")) {

                  System.err.println("HMM Hit rule: " + hit.getHitId() +
" " + hit.getQueryId());

            }

 end

 

rule "Test"

      when

            hit : HmmHit( aboveTrustedHit == true, hitId == "TIGR00549")

            p     : FeatureProperty( id == hit.hitId )

            f     : Feature ( featureId == hit.queryId, properties not
contains p )

      then

            System.err.println("Test rule: " + hit.getHitId() + " " +
hit.getQueryId());

end

 

Notably, this error is dependent on the amount and/or order of facts
loaded into the knowledge session although we're talking < 20k facts
total.  We have repeatedly found problems when running system-level
tests of our production rules that do not appear when we run our unit
tests, with issues such as this one that only show up after loading some
number of facts that are unrelated to the particular fact in question.
It's difficult to debug because we can see that fact handles that
satisfy the when conditions are in the knowledge session (i.e. the same
facts that fulfill the Test rule), but we do not have any obvious way to
debug why the expected HMM Hit rule does not fire.

 

Nelson

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20100706/4f6ef2c6/attachment.html 


More information about the rules-users mailing list