Re: [rules-users] Move the rule file drl
by Davide Sottara
I'd recommend reading the full pathname from a configuration file.. you can
provide your own or use changeset resources. A new (still unofficial)
feature is coming that will help configuring knowledge bases.
Otherwise, you're explicitly telling the program to go and look for that
file in that path.. there's no way it can figure out that another file with
the same name somewehere in your classpath/machine/universe is actually the
drl you're looking for :)
--
View this message in context: http://drools.46999.n3.nabble.com/Move-the-rule-file-drl-tp4020147p402015...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 1 month
mixing activation-group and ruleflow-group
by raffi
Hi,
I am novice in Drools. Up to my following problem nearly everything worked
fine for me.
In my case I thought mixing the two group mentioned is the right way, and it
could be the right way if I use it in a correct way. The problem is that I
don't get a result.
...
rule "pets"
salience 20
ruleflow-group "pets"
activation-group "categories"
when
$tr : Translog($trpid : pid)
$p : Product(pid == $trpid, $pid : pid, $price : price, $brand :
brand)
$pcat : ProductCategory(pid == $pid, $cid : cid)
$cat : Category(cid == $cid, cname == "pets", $cname : cname)
then
insert(new Recommendation($pid, $price, $brand, $cname));
end
rule "remove everything except pets"
salience 19
ruleflow-group "pets"
when
$recomm : Recommendation((cname == "food") || (cname == "vegetable") ||
(cname == "drinks"))
then
retract($recomm)
end
rule "food"
salience 16
ruleflow-group "food"
activation-group "categories"
when
$tr : Translog($trpid : pid)
$p : Product(pid == $trpid, $pid : pid, $price : price, $brand :
brand)
$pcat : ProductCategory(pid == $pid, $cid : cid)
$cat : Category(cid == $cid, cname == "food", $cname : cname)
then
insert(new Recommendation($pid, $price, $brand, $cname));
end
rule "remove everything except food"
salience 15
ruleflow-group "food"
when
$recomm : Recommendation((cname == "vegetable") || (cname == "drinks"))
then
retract($recomm)
end
...
The idea is that I firstly add a new object (Recommendation) to my working
memory. After that I check if there are already existing
Recommendation-objects. Such objects that are from a less important category
should now be removed. The priority attribute is the /cname/ (category
name). So in the end there can be more Recommendation objects of one
category but never of different categories.
I request the result in the following way (perhaps this is incorrect):
rule "show recomms"
salience 5
when
$recomm : Recommendation()
then
System.out.println($recomm);
end
So the result is an empty console, but with my test data there should be two
Recommendation objects in my working memory after terminating.
--
View this message in context: http://drools.46999.n3.nabble.com/mixing-activation-group-and-ruleflow-gr...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 1 month
dialect "mvel" not working in drools template
by himansu.nayak
Hi,
I am trying to use dialect "mvel" in my template and trying to use fields
defined in
my domain object. but not of them are getting access. when i removed dialect
"mvel" then i can accss the fields using the getter's method.
ex:
package com.drools.rules;
dialect "mvel"
.
.
.
when
$admissionObj.Age() > @{Age0} &&
$admissionObj.Age() < @{Age1} // this line throws exception
// the same code works fine if i use getAge() instead of Age() after
removing the dialect "mvel"
-----
Thanks...
Himansu
--
View this message in context: http://drools.46999.n3.nabble.com/dialect-mvel-not-working-in-drools-temp...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 1 month
Drools-Compiler depends on Weld in current SNAPSHOT
by LStampf
Hi,
I am currently working with drools SNAPSHOTS because 5.4.0.Final and
5.5.Beta1 are bugged for our application.
We have a problem with the current drools-compiler. The file
drools-compiler/src/main/java/org/drools/cdi/KProjectExtension.java has a
dependency at the concrete weld implementation:
-import
org.jboss.weld.environment.se.discovery.url.ClasspathScanningException;
I guess that is an oversight, since it would bloat applications just for one
Exception class.
kind regards
Lukas Stampf
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-Compiler-depends-on-Weld-in-curr...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 1 month
Speeding up Drools
by Phani Saripalli
HI.
I am using declared types in my .drl file. I have a declared type with 1000
fields (using the Drools 5.5. beta, so 1000 fields is allowed). I have 100
rules. However, creating the stateful knowledge base is very slow. It is
taking nearly 8 seconds. Can somebody tell me, suggest how can I speed up
the process?
Briefly, this is how I measured.
long loadI = System.currentTimeMillis();
// load up the knowledge base
KnowledgeBase kbase = readKnowledgeBase();
StatefulKnowledgeSession ksession =
kbase.newStatefulKnowledgeSession();
ksession.setGlobal("cList", new ArrayList<Integer>());
FactType fact = kbase.getFactType("com.sample", "Project");
Object projIns = fact.newInstance();
ksession.insert(projIns);
long loadO = System.currentTimeMillis();
System.out.println("time to load facts : " + ((loadO / 1000.0) -
(loadI / 1000.0)));
ksession.getAgenda().getAgendaGroup("Group Config").setFocus();
ksession.fireAllRules();
ksession.getAgenda().getAgendaGroup("Fact Config").setFocus();
ksession.fireAllRules();
ksession.getAgenda().getAgendaGroup("Group 0").setFocus();
ksession.fireAllRules();
ksession.getAgenda().getAgendaGroup("Group 1").setFocus();
ksession.fireAllRules();
ksession.getAgenda().getAgendaGroup("Group 2").setFocus();
ksession.fireAllRules();
Many thanks
Phani
--
View this message in context: http://drools.46999.n3.nabble.com/Speeding-up-Drools-tp4020132.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 1 month
Drools-Planner consulting on rule-set
by drools@orbit-x.de
Hi,
in drools planner I have built an application that has a rule-set with 6 hard-constraint rules and 6 soft-constraint rules. I am optimizing this rule-set now and then already for a very long time (around 2 years).
Currently I am having difficulty with solving local optima problem for this rule-set and am stuck for 2-3 weeks already without any improvement (I think I am missing some POSITIVE soft constraints to achieve score improvement within short number of steps).
So I would like to ask you, guys, if someone would consult me and help me to unstuck. I would gladly pay for your effort and estimate that approx. 8 man-hours should be enough for a drools rules professional to help me to move on.
If you are interested, please contact me with your quotes.
If we reach an agreement, I will send you domain model and rule-set and then we hold 1-2 phone calls to discuss changes in rule-set and domain model. If you would take a look on rule-set before you quote, please let me know.
Thank you and kind regards
Reinis
12 years, 1 month
Communication Error
by paco
Hello Everybody,
I've this error want I'm verifing my rules with guvnor:
Communication Error. This could be caused because you don't have access to
the remote server, or because your browser is in Offline Mode. Please check
your connection and try again. If the problem persists please contact the
System Administrator.
Somebody can tell me what's the probleme?
Thanks
Paco
--
View this message in context: http://drools.46999.n3.nabble.com/Communication-Error-tp4020102.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 1 month
Drools and Weld dependency ?
by Cristiano Gavião
Hi,
I'm trying to use JBPM 5.4-SNAPSHOT and Drools 5.5-SNAPSHOT in a OSGi env.
drools-compiler's generated manifest has a import package to
org.jboss.weld.environment.se.discovery.url.
Could someone explain me what is this new dependency ? Weld is really
mandatory to drools 5.5 ?
thanks,
Cristiano
12 years, 1 month