Facts or rules ?
by Bertrand Grottier
Hello,
I am a newbie with business rules systems.
I would like to implement a component that "compute" the price of products. There can be a great number of potential prices (maybe 10^4 or 10^5).
My first idea was to create template rules, "feeded" by a database. In other words, the information about prices would be contained in the rules.
Eventually, I decided to create Prices objects, that are also inserted in the Knowledge session (Prices become facts). The rule engine just "matches" the appropriate price object with each product (there are other rules then to compute the final price).
Price
{
_productId ;
_beginDate ;
_endDate ;
....
_price ;
}
Product
{
_id ;
_date ;
...
_
}
Are my explanations clear enough ?
Is this a good approach or is it stupid ? Why ? What are the good practices ?
Thank you in advance for your help.
Benoît
_________________________________________________________________
Découvrez comment SURFER DISCRETEMENT sur un site de rencontres !
http://clk.atdmt.com/FRM/go/206608211/direct/01/
14 years, 8 months
5.1 JavaDoc
by David Cracauer
Greetings,
I'm working through some issues with flow, and I want to have a look at the
(complete) doc, including the impl classes. Is this hosted/available
anywhere? I tried to build it from source, and I'm not getting anywhere.
Thanks,
Dave
--
View this message in context: http://n3.nabble.com/5-1-JavaDoc-tp708822p708822.html
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 8 months
drl's and silent failures
by Barry Kaplan
** warning: This is a rant, but it just might save you some head scratching
if you run into these issues **
I really hate writing rules. Not, well not rules, but rules in the DRL
language. There are so many edge conditions that fail silently. Here just
two from today:
...
then
retract(f1) // some comment
retract(f2)
end
In the above retract(f2) will not be invoke. No message about any problems
-- it just doesn't happen. Remove the comment and f2 is retracted.
And, where 'ksession' is a global
...
then
update(ksession.getFactHandle(f1), new MyF1(10, 10))
end
In this one the constructor used for MyF1 does not exists. No message, just
silent failure. Change the rule to:
...
then
MyF1 fi_new = MyF1(10, 10)
update(ksession.getFactHandle(f1), f1_new)
end
And now the error message about the missing constructor is produced.
--
View this message in context: http://n3.nabble.com/drl-s-and-silent-failures-tp704973p704973.html
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 8 months
Logging using JSR94 StatelessRuleSession
by madchen
I set up the rule session basically like this:
RuleServiceProvider ruleServiceProvider =
RuleServiceProviderManager.getRuleServiceProvider("http://drools.org/");
RuleRuntime ruleRuntime = ruleServiceProvider.getRuleRuntime();
(StatelessRuleSession) session = ruleRuntime.createRuleSession( uri, null,
RuleRuntime.STATELESS_SESSION_TYPE);
I can't see a way to use AgendaEventListener because there is no place to
add listeners. I tried using KnowledgeRuntimeLoggerFactory, but I get this
error "org.drools.jsr94.rules.StatelessRuleSessionImpl cannot be cast to
org.drools.event.KnowledgeRuntimeEventManager"
I was wondering if anyone knew of a good way to do logging with this setup?
Thanks,
Kevin
--
View this message in context: http://n3.nabble.com/Logging-using-JSR94-StatelessRuleSession-tp707186p70...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 8 months
Tuples in Agenda Item.
by Rajnikant Gupta
Hi,
I have a doubt regarding tuples. I created a rule using complex types
objects. I am comparing two complex type objecs which have parent-child
relationship eg. "ParentType.equals(ChildType)". I expect this to follow
java rule which allows such comparision. Now when I run the rules with
different values for fields in ParentType and ChildType (which means the
rule should fail) to my surprise it evals to TRUE. Also upon inspection, the
tuple shows me only the ChildType instance not the ParentType.
I would appreciate any help on this.
Regards,
Rajnikant
14 years, 8 months
Drools vs OPSJ
by Bertrand Grottier
Hello,
At the present time, I am evaluating Drools vs OPSJ.
Before I started, I had a look at the following tests: http://blogs.illation.com.au/2009/09/waltz-benchmark-performance-opsj-vs-.... Based on these tests, I was expecting better performances from OPSJ over Drools regarding the rule firing time.
However, I obtained opposite results on a basic test. It consists in a sort of "join clause": I have a few products and many potentiel prices (10^4) in the knowledge session. The aim is to "match" the appropriate prices to each products.
My question are the followings:
- Does someone obtained similar results ?
- Are there situations where Drools outperforms OPSJ ? (apparently yes).
Thank you in advance.
Regards,
Benoît
_________________________________________________________________
Hotmail et MSN dans la poche? HOTMAIL et MSN sont dispo gratuitement sur votre téléphone!
http://www.messengersurvotremobile.com/?d=Hotmail
14 years, 8 months