Ok, can you please open a JIRA with a test case for me to reproduce the
problem? I will investigate.
Thanks,
Edson
2010/7/6 Axelrod, Nelson <naxelrod(a)jcvi.org>
Hi Edson,
Yes, I have been writing and checking the audit log. It shows several
activations of the "test" rule, and I've pasted them below if that
helps. There are no other activation events with fact handles to [19,
6313, 3681] except for the "test" rule.
These two rules intentionally do not have any side effects written in
the RHS, specifically to avoid the case that an activation of one rule
would somehow lead to a change affecting the LHS of another rule or any
other side effects. I load all of the facts before the rules, and no
other code is executed except for the KnowledgeSession fireAllRules()
method followed by dispose().
<org.drools.audit.event.ActivationLogEvent>
<type>4</type>
<activationId>test [19, 6313, 3681]</activationId>
<rule>test</rule>
<declarations>f=Feature.ORF00019(19);
hit=org.jcvi.annotation.facts.HmmHit.ORF00019.TIGR00549.ABOVE_TRUSTED.13
836
502(3681); p=FeatureProperty.TIGR00549(6313)</declarations>
</org.drools.audit.event.ActivationLogEvent>
<org.drools.audit.event.ActivationLogEvent>
<type>6</type>
<activationId>test [19, 6313, 3681]</activationId>
<rule>test</rule>
<declarations>f=Feature.ORF00019(19);
hit=org.jcvi.annotation.facts.HmmHit.ORF00019.TIGR00549.ABOVE_TRUSTED.13
836
502(3681); p=FeatureProperty.TIGR00549(6313)</declarations>
</org.drools.audit.event.ActivationLogEvent>
<org.drools.audit.event.ActivationLogEvent>
<type>7</type>
<activationId>test [19, 6313, 3681]</activationId>
<rule>test</rule>
<declarations>f=Feature.ORF00019(19);
hit=org.jcvi.annotation.facts.HmmHit.ORF00019.TIGR00549.ABOVE_TRUSTED.13
836
502(3681); p=FeatureProperty.TIGR00549(6313)</declarations>
</org.drools.audit.event.ActivationLogEvent>
Nelson
----------------------------------------------------------------------
Message: 1
Date: Tue, 6 Jul 2010 12:39:22 -0400
From: Edson Tirelli <tirelli(a)post.com>
Subject: Re: [rules-users] How is this possible?
To: Rules Users List <rules-users(a)lists.jboss.org>
Message-ID:
<AANLkTik_Ge7ay6M4gcakpUAgccshwCmU7ke2IYNFJhg6(a)mail.gmail.com>
Content-Type: text/plain; charset="windows-1252"
Nelson,
How do you know one rule is firing, but not the other? Are you
checking
the audit log or using an agenda listener for that? Otherwise, if you
think
the rule is not firing because of your println in the consequence, you
might
be looking at the wrong "symptom". There is a huge difference between
writing an "if" like that in the consequence of a rule and writing a
constraint like "hitId == "TIGR00549"" in the condition of the rule,
because
the LHS of a rule is evaluated at "insert" time while the RHS is
evaluated
at the consequence fire time.
So, from the information given, trying to imagine a scenario to
explain
why the syserr in the "test" rule shows up while the one in the first
rule
doesn't, here is a possible explanation:
* You insert the fact HmmHit, it activates both rules, but in a given
time,
before the "Hmm Hit" rule is fired, the value of hitId changes. In this
case, the rule would still fire, but the "if" in the consequence is only
evaluated after the change (during consequence fire time) and so
evaluates
to false, not printing the message.
This is a pretty simple use case and we have several customers/users
with
thousands of rules and millions of facts in a single session and they
are
not facing anything like you described. So, while a bug is always a
possible
explanation, we need a way to reproduce your problem in order to give
you a
proper answer.
Edson
*******************************************
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users