Rules with Lookup Tables...
by jdepaul
I need to evaluate a set of Rules with some of the operators comparing values
from Facts against a changing Lookup Table - for instance:
Some Partners may have several lookup tables defined like this:
NISSAN has partner_ids = {2222, 4444, 5555, 66666} and port_locations =
{ABC, EFG, GEE, FDD...} - these values are stored in the database and need
to be evaluated at run-time.
I suppose one way I could do this is to write a rule like this (sorry,
syntax probably off a bit)...:
rule "partner and port match"
when
$shipment: Shipment(customerName== "NISSAN", partnerID== "2222"
|| customerName=="NISSAN",
partnerID=="3333"
|| customerName=="NISSAN",
parternID=="4444")
|| customerName=="NISSAN",
portLocation=="ABC"
|| customerName=="NISSAN",
portLocation=="EFG"
|| customerName=="NISSAN",
partLocation=="FDD")
then
System.out.println("Found the right one!");
end
Trouble is that the values in these lookup tables change frequently, so I
would like to create a rule that references a lookup table that does a DB
lookup to evaluate the values at run-time - something like this:
rule "partner and port with lookup-table"
when
$shipment: Shipment(customerName== "NISSAN", partnerID in $(partner_ids
) ) <-- db lookup here
|| customerName=="NISSAN", portLocation in
$(port_locations)) <-- db lookup here
then
System.out.println("Found the right one!");
end
I know this is probably a stretch in this case - just wondering if anyone
else was able to solve such a problem?! If so, how -
Thanks,
James
--
View this message in context: http://www.nabble.com/Rules-with-Lookup-Tables...-tf3329159.html#a9256825
Sent from the drools - user mailing list archive at Nabble.com.
17 years, 9 months
RE: [rules-users] update on BRMS
by Anstis, Michael (M.)
OK thanks - get involved I will try (fearing my skills may be
surpassed).
________________________________
From: rules-users-bounces(a)lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] On Behalf Of Mark Proctor
Sent: 01 March 2007 14:49
To: Rules Users List
Subject: Re: [rules-users] update on BRMS
all our code is public and available in subversion, so download
it and get involved as there is still lots do :), mic is gearing up for
a milestone release any day now.
Mark
Anstis, Michael (M.) wrote:
Looks very promising (the rule authoring looks
comparable to ILOG's offering).
I presume this code floats around the Redhat office and
isn't available anywhere as a pre-release candidate, or beta, or
something?
Are there any timings for it's release (will it be
available with 3.2)?
Too many questions - sorry.
Mike
________________________________
From: rules-users-bounces(a)lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] On Behalf Of Michael Neale
Sent: 01 March 2007 13:01
To: Rules Users List; Rules Dev List
Subject: [rules-users] update on BRMS
http://markproctor.blogspot.com/2007/02/brms-introduction-and-progress-u
pdate.html
FYI
Michael.
________________________________
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
17 years, 9 months
RE: [rules-users] update on BRMS
by Anstis, Michael (M.)
Looks very promising (the rule authoring looks comparable to ILOG's
offering).
I presume this code floats around the Redhat office and isn't available
anywhere as a pre-release candidate, or beta, or something?
Are there any timings for it's release (will it be available with 3.2)?
Too many questions - sorry.
Mike
________________________________
From: rules-users-bounces(a)lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] On Behalf Of Michael Neale
Sent: 01 March 2007 13:01
To: Rules Users List; Rules Dev List
Subject: [rules-users] update on BRMS
http://markproctor.blogspot.com/2007/02/brms-introduction-and-progress-u
pdate.html
FYI
Michael.
17 years, 9 months
problem in comparing two dynamic values inside when(condition)
by rajat.khanda@itcinfotech.com
Hi
I am a new user of Jboss Rules.I was trying to run a sample application where inside
"WHEN" i was trying to compare two dynamic values.But the right hand side of that condition check is not getting evaluated.
Here is the drl code
rule "Need FS for LC"
when
m : Quotation( usertype == "LC" , amount > Quotation.LCLLT2 , amount < Quotation.LCHLT2 )
then
//System.out.println("WITHIN RANGE" );
m.setMessage( " Hi "+ m.getVendorname() +", U have requested an order for rs " + m.getAmount() + " as ur LC group, so financial status required");
m.setProceedFlag("medium");
end
Quotation.LCLLT2 value i was trying to get from database . But this value is not getting evaluated here.
Please anyone can help me out .
Disclaimer: This communication is for the exclusive use of the intended recipient(s) and shall not attach any liability on the originator or ITC Infotech India Ltd./its Holding company/ its Subsidiaries/ its Group Companies. If you are the addressee, the contents of this e-mail are intended for your use only and it shall not be forwarded to any third party, without first obtaining written authorization from the originator or ITC Infotech India Ltd./ its Holding company/its Subsidiaries/ its Group Companies. It may contain information which is confidential and legally privileged and the same shall not be used or dealt with by any third party in any manner whatsoever without the specific consent of ITC Infotech India Ltd./ its Holding company/ its Subsidiaries/ its Group Companies.
17 years, 9 months
Dependency of firing the rules
by vijay nooka
hi all,
I am having 3 rules..second rule should fire depending on the fire of first
rule..third rule should fire depending on the fire of second rule....suppose
after firing the first rule(for firing the first rule i used salience) the
second rule is not firing due to unsatisfied conditions, so the third rule
also should not fire..
how can i approach this..with salience..dependancy is not possible...next
option is the agenda groups...i don't know exactly how to implement with
agenda-groups..can any one hep me in this
thanks
vijay
--
View this message in context: http://www.nabble.com/Dependency-of--firing-the-rules-tf3325490.html#a924...
Sent from the drools - user mailing list archive at Nabble.com.
17 years, 9 months
Converting this DRL into a Decision Table
by Vargas, Michael E
Hi,
I'm currently trying to convert this Rules into a Decision
Table:
rule "JobLevel"
when
p : Person( status == Person.NOTRUN, age == "27", person)
then
System.out.println(p.getJobLevel());
p.setJobLevel("You're a rookie");
p.setStatus(Person.RUN);
modify(p);
System.out.println(p.getJobLevel());
end
The thing I can't seem to figure out is how to bind the p variable to an
object person. Any help would be much appreciated!!
Regards,
Michael Vargas
17 years, 9 months
Newbie: Is this feasible w/ Drools?
by Alexander Richter
Hello,
I work in a bioinformatics group and we're interested in using Drools
for setting up an assertion engine for biological processes.
We have over 300 genomes ( == sets of facts), each with upwards of
10K genes/features with annotations ( == facts). We want to be able
to predict whether various biological processes exist, based on
presence of the annotated genes that are the components of the
process. Asserted processes are not black and white; we may have
various levels of certainty, based on the percentage of component
genes found (because we can't be certain that not finding a certain
annotation means the the gene isn't in the genome -- it could mean
that we just didn't find it). In addition, processes tend to be
composed of sub-processes. The assertions then get used to make
additional annotations on the features, which we then use to help us
look for missing components. Therefore, we need to be able to display
the decisions that led to a specific assertion, as well as the
features that went into the component assertions.
In addition, we regularly add new processes, as we get new ways to
annotate genes, or read about newly worked-out processes. We really
don't want to have to run all rules against all the genomes every
time we add a new rule, but just add that rule.
We would like to define the actual rules for the assertions in
Drools, but don't know how we would do certain parts.
1) Can one walk through the rule hierarchy from a given rule and
tease out the hierarchy of rules and the facts that went into that rule?
2) Is it possible to add a rule, or set of interacting rules, and
have them incrementally evaluated, instead of forcing full
evaluation? Alternatively, can the rulesets be individually defined
and run in such a way that they interact?
Thanks,
Alexander Richter
17 years, 9 months
RuleBaseImpl Error - Help needed
by kingston
Hi,
I am a beginner.
I am using DSL Syntax. I get errrors like
org.drools.rule.InvalidRulePackage: unknown:7:48 mismatched token:
[@16,48:49='&&',<55>,1:48]; expecting type ')'
unknown:8:0 Unable to expand: ;. Due to Expression was not expandable:
at org.drools.rule.Package.checkValidity(Unknown Source)
at org.drools.reteoo.RuleBaseImpl.addPackage(Unknown Source)
at student.DroolsStudent.main(DroolsStudent.java:50)
Where can i get the API documentation for RuleBaseImpl classs and other
classes like WorkingMemoryImpl ?
Are there any sets of DO's and DONT's to be followed frame rules in DSL
Syntax ?
--
View this message in context: http://www.nabble.com/RuleBaseImpl-Error---Help-needed-tf3308727.html#a92...
Sent from the drools - user mailing list archive at Nabble.com.
17 years, 9 months