All the values from one list must be present in other
by Suvek
I tried looking for similar posts but could not find any that fits the
requirements.
Really speaking this is a 2 part question.
What I need to do is compare 2 lists and ensure that all the fields inside
the reference list are present in passed in list.
following is the simplified version of test that I want to perform...
$requiredAddressTypes : List() from [ AddressType.BUSINESS,
AddressType.FOREIGN_BUSINESS ]
$taxpayer : Taxpayer(taxpayerType == TaxpayerType.FOREIGN_BUISINESS &&
addresses.size > 0,
$addresses : addresses)
1 - Based on the taxpayer type I need to ensure that ALL the
requiredAddressTypes must be present, how can I achieve this?
2 - is the this statement correct ? ($requiredAddressTypes : List() from [
AddressType.BUSINESS, AddressType.FOREIGN_BUSINESS ])
--
View this message in context: http://drools.46999.n3.nabble.com/All-the-values-from-one-list-must-be-pr...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 5 months
empty cell in excel makes the LHS missing in the rule
by himansu.nayak
Hi,
i am using drools 5.4.0 and currently facing a typical problem. when ever
any cell for LHS in the spreadsheet is blank. when the rules is compiled
using the spreadsheet, the LHS for the empty cell get completely missed.
drools don't even consider it as a empty string. The only workaround i found
is to fill all empty cell with N/A and then merging the cells, which looks
like a patch work.
Any other way thru with i can tell drools to treat empty cells as empty
string?
-----
Thanks...
Himansu
--
View this message in context: http://drools.46999.n3.nabble.com/empty-cell-in-excel-makes-the-LHS-missi...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 5 months
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.
13 years, 5 months
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.
13 years, 5 months
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.
13 years, 5 months
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.
13 years, 5 months