Please refer to the Drools Reference Document.
http://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/drools-expert/html/ch02.html#d0e254
http://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/drools-expert/html/ch02.html#d0e254
Sample code from it to add rules in a drl file.:
As far as I know, Drools can only reason over facts in the working memory. It
can not directly select from RDBMS. You have to load in all data items
from the database and validate them in memory by Drools.
--
View this message in context:
I want to add several rules into a KnowledgeBuilder instance through
invocation of kbuilder.add() for each rule.
I want that if one rule fails to be added, the remaining rules can still be
added into kbuilder for business validation.
However, this seems not to be the default behavior. If one rule
According to Section 3.3.7 StatelessKnowledgeSession of
http://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/drools-expert/html/ch03.html#d0e1956
the Drools document , the act of calling execute() is a single-shot method
that will internally instantiate a StatefulKnowledgeSession.
Why
The general advice as of now is still to avoid using from with
lock-on-active, but I expect that restriction to be lifted in drools 6.
- I think this is the ultimate advice, we, as users, should take.
Thank you for so much explanation on the internal. I will ask more on the
internal if time
I am now using Cobertura to evaluate the test coverage on my Java
application.
However, Drools rules are not counted by Cobertura, because classes for
rules are dynamically created and therefore not instrumented by Cobertura
for static analysis.
How can we automatically analyze the test coverage
Yes, this can be the low-level infrastructure to implement the functionality
comparable to that of Cobertura, which I think is not practical for we rule
engine users to do without much effort.
--
View this message in context:
I am trying to understand why care should be taken to use from and
lock-on-active together, as is described in Section 4.8.3.8. Conditional
Element from of
http://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/drools-expert/html/ch04.html
the Drools Reference Document .
It says the use of
Thank you. I understand it now:
In the 2nd rule:
modify($p) = evaluate the 2nd rule again = re-iterate $p.address with
from, so that Drools engine can know if there is any change in $p.address
compared with previous evaluation.
Also, the above modify($p) also triggers evaluation of the 1st rule.
You explanation is very reasonable:
the engine assumes anything within $p may be changed by modify($p), although
$p.address is not changed actually.
However, I tried these rules myself and both rules were fired. Why?
According to the document, only one of the rules should fire; the other's
OK. You mean the behavior differs by versions. My above test in which both
rules fired was using Drools 5.1.1.
Questions:
1. Since the lock and no-loop features are based on the fact handles, the
sometimes undesired interaction occurs.
Could you elaborate more on how is lock-on-active based
11 matches
Mail list logo