Web Decision Tables & functions
by Richard Evans
Is it possible to define a column in a Web Decision Table with a function
call template so that data values are passed to a function - say
eval(Fact.check($1)) - as it is in spreadsheet tables?
Thanks
Richard
Richard Evans
07985 437 517
www.thoughtbreak.com
15 years, 9 months
RE: Re-using rules in overlapping "groups"
by Richard Evans
Hello folk.
I am trying to work out the best way to use drools for an application where
I have :
- A domain of @30 fairly complex policy rules each of which has a
Boolean outcome (Fired or Not)
- A domain of @100 "audiences" who apply different subsets of the
policy rules and make their own "Decision" based on the policies that have
fired.
I am very keen:
a) NOT to duplicate the Policy rules themselves
b) To make mapping of audience & policy to decision as simple as
possible - ideally through a table
c) To keep all decision data in the same repository for uniform
version control
My thinking is that I'd have a flow, first execute the policy rules as one
group and save results in working memory and then use these results in an
audience-specific way.
I get stuck at this second step as I cannot find a compact way to handle the
mapping of Audience/Policy to Decision. Logically what I need to achieve is
as follows. E.g. for audience 1, if policy 1 fires, we decide to refer. (If
more than one has fired, decline trumps refer).
Audience policy1 policy2 policy3 policy4 ...
audience1 refer refer decline (n/a)
audience2 (n/a) decline decline (n/a)
...
Clearly I could do this outside Guvnor but then the UI would be outside
Guvnor & the data would be separated from the drools jcr repo.
I hoped to achieve a rule table as follows (fairly compact) but this would
require DISJUNCTION between cols
Audience policy1 policy2 policy3 policy4 Action
audience1 true true refer
audience1 true decline
audience2 true true decline
If I broke out a rule for every combination of audience and policy this
would get very long.
Any smart ideas? Thanks in advance to anyone who spares the time to think on
this one!
Rich
PS. I attempted to post this about 3 hours ago but believe I made a mistake.
Sorry if it comes through as a duplicate
15 years, 9 months
Rules with from always loops (Drools 4.0.7)
by Przemysław Różycki
Hello,
why does such a rule always loop? Even if no-loop is used?
rule "Hello World"
no-loop
when
$fact1 : MyFactBean1( )
$fact2 : MyFactBean2( ) from $fact1
then
System.out.println("Fired!!!");
update($fact1);
end
The full code of my test application and drl is attached.
Best regards,
--
Przemysław Różycki
AMG.net, A Bull Group Company
ul. Łąkowa 29
90-554 Łódź
www.amg.net.pl
package com.sample
import com.sample.DroolsTest.MyFactBean1;
import com.sample.DroolsTest.MyFactBean2;
rule "Hello World"
no-loop
when
$fact1 : MyFactBean1( )
$fact2 : MyFactBean2( ) from $fact1
then
System.out.println("Fired!!!");
update($fact1);
end
15 years, 9 months
Re: Drools solver performance question
by Geoffrey De Smet
Hi Greg,
Yes, I expected that too, but my experiments proved me wrong (for now).
The current implementation of accumulate backwards chains I believe.
Backward chaining doesn't do score delta calculation, so it's very bad
for scalability.
Try it yourself with the nqueens example.
Uncomment the code in nqueensScoreRules.drl and see what happens if you
go from n=8 to n=16 and more.
With kind regards,
Geoffrey De Smet
Greg Barton schreef:
> I answered a performance question a user had about
> drools-solver, but I'm afraid I answered with a touch of
> ignorance about the way drools-solver is set up. His rules
> had a new object being inserted into the working memory each
> time a constraint rule was matched. The constraint objects
> were then accumulated by a low priority rule at the end.
> After looking at the drools-solver examples it looks like
> they're all that way. It strikes me that having a
> single accumulator object, and not creating and inserting a
> new object in each constraint rule, would be more efficient.
> Is it possible to set this up in a solver ruleset?
>
> Thanks,
> GreG
>
>
>
>
>
15 years, 9 months
Drools Performance
by Ashish Soni
Hi All ,
I am not sure if this question is asked previously but it would be great if
any one can put some lights on this ..
If i have 10,000 rules with same priority or equal priority then how drools
engine evaluate them or what is the path it chooses.
Also if there any performance metrics available ,please point to the links.
Thanks and Regards,
Ashish soni
15 years, 9 months
StatefulKnowledgeSession insert Fact using Dynamic option ?
by Remi Barraquand
Hi everyone,
Well i'm trying to upgrade my project to use the last Drools 5.0 API
(5.0.0.M4) and i don't understand something, where is the insert(Object
object, boolean dynamic) method gone ?
In the project i'm working on, one important aspect is to be able to change
the properties of a fact both from Java side and from Drools side. That is
calling
myFact.setPropertyName(theValue);
on the java side should modify the fact in the working memory and of course
doing
modify( $myFact ) {
property = theValue
}
in a rule should modify the value of that fact on the java side.
In the 4.0.7 version of drools i was using firePropertyChange in each setter
to propagate the change, and i inserted each fact in the working memory
using the insert(myFact, true) method. However in the new 5.0 API this
function is gone from the StatefulKnowledgeSession class
(WorkingMemoryEntryPoint).
How could i use dynamic fact using Drools 5.0 ? what should i need to
change, or what i did i miss ? :)
Thanks a lot for any help.
Rémi
-----
________________________________________
Rémi Barraquand, PhD I.N.P.G
Projet PRIMA - Laboratoire LIG
INRIA Grenoble Rhones-Alpes Research Centre
655 Ave de l'Europe
38330 Montbonnot, France
http://barraquand.fr Barraquand
http://bois-chauffage.fr Bois de Chauffage
http://ecoboisenergie.fr Eco Bois Energie
http://venteboisdechauffage.com Vente Bois de Chauffage
--
View this message in context: http://www.nabble.com/StatefulKnowledgeSession-insert-Fact-using-Dynamic-...
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 9 months
creating a rule and stroring in a drl file using APIs
by sandeep bonkra
Hi,
I am new to Drool. I need one clarification.
Can we create a rule and then store it to a .drl file using drools APIs. I
have successfully created a rule using the APIs (Rule, Pattern etc).
Although it is getting compared with Facts also. But i need to store the
rule in drl and updated the rule whenever a user enters a new rule.
I would really appreciate you guys for providing any help in this regard.
Thanks in advance. Please guide.
Regards,
Sandeep
15 years, 9 months
creating a rule and storing in a drl file using APIs
by sandeep bonkra
Hi,
I am new to Drool. I need one clarification.
Can we create a rule and then store it to a .drl file using drools APIs. I
have successfully created a rule using the APIs (Rule, Pattern etc).
Although it is getting compared with Facts also. But i need to store the
rule in drl and updated the rule whenever a user enters a new rule.
I would really appreciate you guys for providing any help in this regard.
Thanks in advance. Please guide.
Regards,
Sandeep
15 years, 9 months
Adding multiple packages
by Ashish Soni
Hi All ,
Can some one please show an example how can i add and build multiple
packages for executing rules.
Regards,
Ashish
15 years, 9 months
Drools rule writing question
by Denny Lee
Hello,
I am new to Drools. We have been using JESS for a while and ran into a problem that we cannot solve and is hoping Drools have a solution. Is there anything in the Drools language / rules that allows for
temporal evaluation within the rules? What I mean is, say your rule
examines 2 variables, var1 and var2, and if both are true it fires. Is
there any way/technique to say "If var1 becomes true and var2 was
ALREADY true, fire" and "If var1 was ALREADY true and var2 becomes
true, DO NOT fire?" I've worked w/ JESS and there is nothing built
into the language that does this. Is there something in Drools that can handle this or some general techniques that can deal with something like this?
Thanks.
Denny
15 years, 9 months