Re: [rules-users] How to Ignore Rule Compilation Error and Continue to Compile Other Rules?

2011-02-14 Thread hyjshanghai
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.:

Re: [rules-users] Applying rules on the data in an RDBMS

2011-02-14 Thread hyjshanghai
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:

[rules-users] How to Ignore Rule Compilation Error and Continue to Compile Other Rules?

2011-02-13 Thread hyjshanghai
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

[rules-users] Why StatelessKnowledgeSession Instantiates a New StatefulKnowledgeSession on Each execute()?

2011-01-27 Thread hyjshanghai
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

Re: [rules-users] Why Using from Always Return A New Fact?

2011-01-21 Thread hyjshanghai
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

[rules-users] How to Analyze Rule Test Coverage?

2011-01-21 Thread hyjshanghai
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

Re: [rules-users] How to Analyze Rule Test Coverage?

2011-01-21 Thread hyjshanghai
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:

[rules-users] Why Using from Always Return A New Fact?

2011-01-19 Thread hyjshanghai
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

Re: [rules-users] Why Using from Always Return A New Fact?

2011-01-19 Thread hyjshanghai
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.

Re: [rules-users] Why Using from Always Return A New Fact?

2011-01-19 Thread hyjshanghai
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

Re: [rules-users] Why Using from Always Return A New Fact?

2011-01-19 Thread hyjshanghai
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