Reloading DRL files from a web interface + incoming requests
by Julius
Hello. I am new to Drools and have seen similar questions to mine, but I need
some more detail and would love to see some insight from a Drools pro for
our particular scenario :-)
We are testing Drools as part of our web application backend. We want Drools
to make some decisions based on a number (let's say 10) parameters we find
in the incoming HttpRequest.
Also, we are building a web admin interface that allows users to make
changes to the Drools files that contain the business logic. We created a
simple interface that allows users to create filtering rules. We store those
rules in the database (field, operator, compare_against_vales, etc).
Every time a user makes a change to a rule in the web admin interface (add
rule, delete rule, add condition, delete condition, update condition, etc)
the DRL file(s) must be regenerated and re-fed to Drools.
I have a couple of questions about this:
1. How do we reload DRL files in the most efficient way? (A small code
sample or a link would be great)
2. Could we create multiple small DRL files instead of one big one and would
we get better performance when we only reload the (small) changed files into
Drools as opposed to putting everything in one file and regenerating and
reloading that?
3. Do we run the risk of Drools being "busy" with reloading DRLs while we
have new Drools jobs (HttpRequests) waiting and what would happen, would we
suffer a delay or do we run the risk of Drools being "unavailable"?
The app is business critical. It doesn't have a super high load at the
moment, but load could grow in the future and we want to plan for the worst:
- a user in the web admin makes a number of changes to conditions and
submits those, so we have to reload DRLs
- at the exact same moment 5 incoming requests need to be evaluated by
Drools
4. Can Drools manage this worst case scenario?
Thanks very much for your time.
--
View this message in context: http://drools.46999.n3.nabble.com/Reloading-DRL-files-from-a-web-interfac...
Sent from the Drools: User forum mailing list archive at Nabble.com.
10 years, 9 months
KnowledgeAgent, when to stop notifier/scanner services?
by Peach Wyss
Hy all
I have seen a few references warning that the change notifier and
change scanner services must be stopped or a memory leak can occur, but
where would I stop them?
The knowledge base needs to "live on" and be updated as new knowledge sessions are created from it. So the
only place I would be stopping these services and disposing of the knowledge agent, would be when the server is restarted. Is this
incorrect? If so, *when* would be an appropriate time to stop these
services?
Thanks for your help.
Kind regards,
Peter
10 years, 9 months
Broken KIE-WB binary for Tomcat 7
by Sandjaja, Dominik
Hello,
I just tried to install the KIE-Workbench on Tomcat 7 out of the downloaded file kie-drools-wb-distribution-6.0.1.Final.zip with authentication.
It turns out that obviously the web.xml inside the WAR in binaries/kie-drools-wb-distribution-wars-6.0.1.Final-tomcat7.0.war is wrong. It is missing some elements which have to do with authentication so that the whole installation process, described in the README.txt does not work.
In 6.1.0.Beta1, that problem is fixed.
On the other hand, the kie-tomcat-integration-6.1.0.Beta1.jar seems to be broken, at least I can't start my tomcat with that one in the lib folder. This problem can be circumvented by using kie-tomcat-integration-6.0.1.Final.jar instead, that one works.
In total: Only the .war from 6.1.0.Beta1 together with kie-tomcat-integration from 6.0.1.Final is a working combination on a Tomcat 7.0.26.
That seems a bit sad, given that this combination should not be the most uncommon one (running KIE-WB on Tomcat). You guys are making it really hard to switch to Drools 6 ...
Regards
Dominik
…………………………………………………………………
mit freundlichen Grüßen / kind regards
Dominik Sandjaja
Fon: +49 (0) 203 60878 183
Fax: +49 (0) 203 60878 222
e-mail: dominik.sandjaja(a)it-motive.de
it-motive AG
Zum Walkmüller 6
47269 Duisburg
info(a)it-motive.de
http://www.it-motive.de
……………………………………………………………………
Vorsitzender des Aufsichtsrats: Dr.-Ing. Jürgen Sturm
Vorstand: Horst-Dieter Deelmann (Vors.), Matthias Heming, Christoph Tim Klose
HRB 9207, Amtsgericht Duisburg
10 years, 9 months
Restore a guvnor installation from db
by maruthir
Hi All, I have lost a guvnor installation with a lot of rules in it. All I
have now is the exported binary package and the database. Installation and
repository folders are gone. Is there a way to recover my setup? I can see
the rules in the database in some encoded form. Pls help.. this data many
many days of work.
I tried pointing the repository xml to this database but I dont see the
rules in the UI.
thanks,
MJ
--
View this message in context: http://drools.46999.n3.nabble.com/Restore-a-guvnor-installation-from-db-t...
Sent from the Drools: User forum mailing list archive at Nabble.com.
10 years, 9 months
function in guided decision table
by Ioannis Christodoulou
Hello everyone.
I'm using the latest kie workbench and I have created a guided decision
table.
I want to create a function and call it from an action of the guided
decision table.
The problem is that I cannot find a way to declare the function and make it
visible from the guided
decision table. I have tried declaring it in a drl file, as well as in a
dsl definition without success (the error is that drools cannot analyze the
function call expression).
Has anyone solved this issue before?
Kind regards.
10 years, 9 months
(no subject)
by Sandhya Sree
hi,
i have the following rule file :
rule "size"
when
$p: RuleContext($size: getOldContext().getParent().getUsableSpace() >
(30*1024*1024))
then
Event event = new Event("folder almost full",
$p.getOldContext().getParent(), new Date());
event.display();
end
im loading this rule file and executing the rules once in 10 seconds in a
continuous loop from my java class. assuming the when part is always true,
the event object created gets displayed each and every time once in 10
seconds. i want to create the object only once with the fact that the event
is already there.. i.e. i dont want to create the object again if it is
already created.. how can i do that?
Thanks.
10 years, 9 months
NullPointerException with factType.get(fact, "fieldname")
by JarkkoMakela
Drools version 6.0.0.FINAL
I create rule package in Drools workbench and use default knowledgebase and
session:
KieServices kieServices = KieServices.Factory.get();
KieContainer kContainer =
kieServices.newKieContainer(kieServices.newReleaseId("com.test",
"validationrules", "1.0-SNAPSHOT"));
KieBase kbase = kContainer.getKieBase();
KieSession ksession = kContainer.newKieSession();
I have a query that returns ValidationError:
query "getValidationErrors"
validationError: ValidationError()
end
ValidationError is returned and it has values in its fields, but when i try
to read fields of that ValidationError fact, i get NullPointerException
public class DroolsValidationMessage {
private FactType factType;
private Object fact;
public DroolsValidationMessage(KieBase kbase, Object fact) {
this.fact = fact;
factType = kbase.getFactType(fact.getClass().getPackage().getName(),
fact.getClass().getSimpleName());
}
public String getSeverity() {
return (String) factType.get(fact, "severity"); // <--
java.lang.NullPointerException
}
public String getDescription() {
return (String) factType.get(fact, "description");
}
}
factType looks like this:
ClassDefinition{className='null', superClass='java.lang.Object',
interfaces=[], definedClass=class com.test.validationrules.ValidationError,
traitable=null, abstract=false,
fields={description=FieldDefinition{name='description',
type='java.lang.String', key=false, inherited=false, index=0,
initExpr='null', annotations=null, accessor=null},
severity=FieldDefinition{name='severity', type='java.lang.String',
key=false, inherited=false, index=1, initExpr='null', annotations=null,
accessor=null}
This works if the rules and declared class is in resources folder and
kmodule.xml is used.
KieServices kieServices = KieServices.Factory.get();
KieContainer kContainer = kieServices.getKieClasspathContainer();
KieBase kbase = kContainer.getKieBase("kbase");
KieSession ksession = kContainer.newKieSession("ksession");
factType looks like this:
ClassDefinition{className='com.test.validationrules.ValidationError',
superClass='java.lang.Object', interfaces=[java.io.Serializable],
definedClass=class com.test.validationrules.ValidationError, traitable=NONE,
abstract=false, fields={description=FieldDefinition{name='description',
type='java.lang.String', key=false, inherited=false, index=0,
initExpr='null', annotations=null, accessor=[ClassFieldExtractor
class=com.test.validationrules.ValidationError field=description]},
severity=FieldDefinition{name='severity', type='java.lang.String',
key=false, inherited=false, index=1, initExpr='null', annotations=null,
accessor=[ClassFieldExtractor class=com.test.validationrules.ValidationError
field=severity]}
-Jarkko
--
View this message in context: http://drools.46999.n3.nabble.com/NullPointerException-with-factType-get-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
10 years, 9 months