impossible to dispose tomcat devloader when i reload context (drools keep reference)...
by Emmanuel GREFFET (France)
Hello
I'm Emmanuel from France. (sorry for my English)
We use drools 4.0.7 in a hospital application.
We load drools and our programs (services) with tomcat Devloader (5.5.9)
We use drools in statefullsession (retract and insert facts by rules in a
ruleFlow).
everything is perfect for us, except a little problem of "dispose" with
tomcat due to drools.
Through the Tomcat console when we try to restart our webapp, tomcat can't
dispose the old Devloader
(in Eclipse we can see that many drools class use class attribute
ClassLoader without any dispose ???)
In production, we used different webapps in a Tomcat, so we can't easely
stop Tomcat, so until we stop tomcat, the reload of the webapps is longer
and longer ... (many devloader(s) can't dispose)...
anyone has had this problem ?
Thank you.
Emmanuel
--
View this message in context: http://www.nabble.com/impossible-to-dispose-tomcat-devloader-when-i-reloa...
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 5 months
Problems with ruleflow
by Femke De Backere
Hi,
I have a problem with an easy Rule flow project (source code included
in this mail). The only thing that should happen is the execution of a
rule flowgroup, but my application ends before executing the group...
Does anybody see the problems? I tried every possible adaptation and
based this problem on a similar, working feverapplication... But is
still doesn't work and I really can't find the problem.
Thx,
Femke
15 years, 5 months
Advice on organizing rules
by glasscat
I'm using drools 5.0.1.
I've written the following rules to retrieve objects from the working
memory. Questions:
1) whether there is a better way to organize the rules. For instance the
rule "checkvalidresponse" right now checks for both successful retrieval and
unsuccessful retrieval. Should I split it to 2?
2) When I do drools.update(response) in the "default" rule, it seems to be
in endless loop.
3) The response value set in "retrieve" rule is not updated when rule
"checkvalidresponse" is triggered. Do I need to do drools.update(response)
in the "default" rule?
4) Should I set the response code in the "retrieve" rule and remove the
"checkvalidresponse" rule?
Thanks
rule "default"
dialect "java"
agenda-group "retrieve"
salience 50
when
Request(sfid : ProductIdentifier)
trdata : Data(Identifier == sfid)
response : Response(product == null)
ServiceResponse(responseCode == 0) from
response.getServiceResponse()
then
response.setProduct(trdata.getProduct());
// should I set response code here or let "checkvalidresponse"
handle it?
// do I need to update here?
// drools.update(response);
end
# Shoud I split this to 2? 1) check for successful query and 2) check for
unsuccessful query?
rule "checkvalidresponse"
dialect "java"
agenda-group "retrieve"
salience 20
when
Request()
response : Response()
sres : ServiceResponse(responseCode == 0) from
response.getServiceResponse()
then
String rname = drools.getRule().getName();
System.out.println("Rule: \"" + rname + "\" triggered");
Product prod = response.getProduct();
// Check if a valid Product found
if ( prod == null ) {
sres.setResponseCode(9);
sres.setResponseMessage("Product not found");
sres.setExceptionCode(9999);
sres.setExceptionMessage("");
} else {
sres.setResponseCode(0);
sres.setResponseMessage("The operation completed
successfully");
sres.setExceptionCode(0);
sres.setExceptionMessage("");
}
response.setServiceResponse(sres);
drools.update(response);
end
# Credentials
# The only valid credential: User Id: User Password: Password
#
rule "checkcred"
dialect "java"
salience 50
when
request : Request()
response : Response()
cred : Credentials(userName != "User" || password != "Password")
from request.getCredentials()
sres : ServiceResponse(responseCode == 0) from
response.getServiceResponse()
then
String rname = drools.getRule().getName();
System.out.println("Rule: \"" + rname + "\" triggered");
sres.setResponseCode(9);
sres.setResponseMessage("Invalid credentials");
sres.setExceptionCode(9000);
sres.setExceptionMessage("");
response.setServiceResponse(sres);
drools.update(response);
end
# Transaction context
# Valid channel: channel01 or channel02
#
rule "checktrctx"
dialect "java"
salience 40
when
request: Request()
response: Response()
ctx : TransactionContext(channel != "channel01" && channel !=
"channel02") from request.getTransactionContext()
sres : ServiceResponse(responseCode == 0) from
response.getServiceResponse()
then
String rname = drools.getRule().getName();
System.out.println("Rule: \"" + rname + "\" triggered");
System.out.println("Invalid transaction context: " +
ctx.getChannel());
sres.setResponseCode(9);
sres.setResponseMessage("Invalid transaction context");
sres.setExceptionCode(9001);
sres.setExceptionMessage("");
res.setResponse(sres);
drools.update(res);
end
rule "requestgood"
dialect "java"
salience 1
when
Request()
response : Response(product == null)
ServiceResponse(responseCode == 0) from
response.getServiceResponse()
then
String rname = drools.getRule().getName();
System.out.println("Rule: \"" + rname + "\" triggered");
System.out.println("Request is good");
drools.setFocus("retrieve");
end
--
View this message in context: http://www.nabble.com/Advice-on-organizing-rules-tp24742646p24742646.html
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 5 months
How to Enrich Facts with Data from a Database
by Ken Archer
I would like to append values to facts in working memory with
values from a database before rules processing. The Fusion documentation
says, “one of the most common use cases for rules is event data enrichment”,
but no documentation seems to explain how this is done whether we’re talking
about events or just plain old facts. And the RHS syntax seems to be
limited to working with data already in working memory. How can I enrich
facts with data from another system? Thanks in advance.
Ken Archer
Telogical Systems
15 years, 5 months
Problem Sharing rules between Rule Flow group
by surya_n2007
Using 4.0.7 version
Our requirement is we need to share rules between different projects. So we
have grouped the rules into ruleflow group say Group A has 2 rules, GroupB
has 4 rules.Shared GroupB i.e 4 rules in different projects X,Y. Now the
business requirement changed for project Y in GroupB one of the rule doesnt
satisfied.
Solution : Divide the rule flow groupB into GroupB 3 rules ,Group C 1 rule
but we need to test both the projects we dont want to do that .
Please let me know any other solution ? Can a rule be part of different rule
flow groups as shown below.
rule "Rule3" ruleflow-group "GroupB,Group X"
Cheers
Surya.
--
View this message in context: http://www.nabble.com/Problem-Sharing-rules-between-Rule-Flow-group-tp247...
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 5 months
How to define an Enumeration when using "Guided Editor" in Eclipse?
by data data
Hi all
Probably a simple question, but I did not find any hint on this topic.
I am using drools 5.0 in eclipse. There I started to write "business rules"
with the "guided editor". Now I like to introduce some enumeration for some
attributes in my model. In the web based version "Guvnor" is this no big
deal, there you have the option to add new "enumerations". But how can you
achieve the same thing in eclipse? I studied the "package" file syntax, but
there I found no such option (or it is not documented).
Any suggestions and hints?
Many thanks for your help in advance.
regards
Mark
15 years, 5 months
Accessing drools rule file in a jar
by Zhang Jing-A52198
Hi All,
I'm trying to load a pkg file by RuleAgent. I use the following in the
class DroolsRuleProcessor in the package com.example:
************************************************************************
******
String packageFILE = "com.example.rule1.pkg";
URL u = DroolsRuleProcessor.class.getResource(packageFILE);
Properties props = new Properties();
props.setProperty("file", u.getFile());
RuleAgent ag = RuleAgent.newRuleAgent(props);
************************************************************************
******
The package file com.example.rule1.pkg is put under the same java
package as DroolsRuleProcessor (i.e., com.example).
The above code works fine when executing locally. However, error occurs
when I try to execute it remotely. I pack the class DroolsRuleProcessor
with the pkg file com.example.rule1.pkg into a jar, put the jar into an
ear file and deploy the ear to a server. The RuleAgent cannot find the
pkg file. I guess the reason might be that RuleAgent uses new File(...)
to access and read the file. However, new File(...) cannot get the file
that is contained a jar.
So how can I access the pkg file using RuleAgent in this case?
Thanks,
Jing
15 years, 5 months
Relation between Guvnor and Expert in Drools5.0
by Sumant Kumar
Hi All,
Can you throw some light on Relation between Guvnor and Expert components in Drools5.0.
Guvnor sounds like BRMS so does it have Rule engine ( or runtime) to execute rules ?. Is Expert module part of Guvnor ?
If Guvnor doesn't have rule engine how does it excute rule when we do QA.
I cannot find Expert module for down load. Is Rule engine runtime bunch of jars ( Drools-core.jar etc )
thanks
Sumant
15 years, 5 months
Import Existing DRL in Guvnor never finishes
by Steve Ronderos
Hello All,
I'm experiencing an issue importing an existing DRL into Guvnor, we made
a sample DRL file containing 1000 very simple rules that look something
like this:
rule "testa4"
dialect "mvel"
when
IOption( selected == "false" && id == "9934" )
messageSection : INode( id == "Drivers" )
then
messageSection.setValidationMessage( "null" );
messageSection.setValidationMessageDuration( null );
end
Each rule has a unique name. The problem is that the import hasn't
finished (after over 2 hours) and when we look at the resources that have
been imported they have 24 revisions each. It looks like Guvnor is
importing the file over and over again.
Has anyone experienced anything like this?
Thanks,
Steve Ronderos
15 years, 5 months