setting different value in consequence ( RHS part) based on a conditional check
by vadlam
Hi,
we have an existing BRL rule in Guvnor whereby we set the value of some
fields in RHS based on some value checks in the condition part. we have
created several of these rules already in a previous release.
In the next release, we have new requirements to set the value of an
existing field in consequence to be of 2 different values based on a
specific conditional evaluation. the rest of the rule remains the same.
to clarify,
when
samplefact1( status== "active" , state=="CA" )
then
Response fact0= new Response();
fact0.setField1( "Y" );
fact0.setName( "something " );
insert(fact0 );
end
we now have to change this to set Field1 value to Y or N based on some
updated condition for status field.
lets say if status=="active" , Field1 has to be Y, but when status=closed,
then Field1 has to be N
Please keep in mind that the rest of the rule remains the same.
is there a way to set the value of Field1 to be Y or N within the
consequence part of same rule without having to create another rule .
will the use of functions or variables be of any help in this case?
--
View this message in context: http://drools.46999.n3.nabble.com/setting-different-value-in-consequence-...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 10 months
Problem splitting drl file into two files
by Shur, Bob
How do I declare a function in one drl file and call it from another drl file, without having the Eclipse plug-in flag the call as an error?
Eclipse complains that the function is undefined and puts a red X on the call.
Other than the red X, everything seems to work. Is there some equivalent of "extern" I can use to make Eclipse happy?
12 years, 10 months
How to write rules in two fact's fields?
by shanmuga
Hi,
I want to know, how to write rules in two fact's fields?
I used two facts, it will take AND condition or OR condition in between the
two facts.
Please check my code....
package Project
import com.sample.Person;
import com.sample.Price;
rule "rule_Name"
when
per:*Person*(50 <= age < 100, 10000 <= income < 50000, occupation
== "Business", category == "Military", location == "Bangalore", custype ==
"Individual")
pri:*Price*((20 <= price < 30) || price == 1)
then
System.out.println("Success");
end
The both fact values are satisfy means, what is the output?
I got output, even the *Price* fact's value is wrong. (price == 100)
Please slove my problem........!!!!
--
View this message in context: http://drools.46999.n3.nabble.com/How-to-write-rules-in-two-fact-s-fields...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 10 months
drools working memory backed by cache
by Apache Zoom
Is there a project out there which can use drools working
memory using hibernate 2nd level cache ( i.e. if the objects in working
memory get too old they get put in a cache )
A second related question is it would be nice if it could be done through hibernate using hibernate 2nd level cache ?
12 years, 10 months
How to even out n buckets in Drools Planner?
by aitchnyu
I have n buckets and mn entities. Each bucket must have m entities. Each
entity carries a weight. My objective is to even out the total weight per
bucket, make them close to the average.
For example, a solution like this is skewed, see their sums.
bucket 1: 1,2,4,5=12
bucket 2: 6,8,9,6=29
bucket 3: 7,7,4,7=25
The same entities may be placed into buckets like this. This is more
desirable as the sums are closer to the mean (and each other); one does not
dominate the others.
bucket 1: 1,8,7,4=20
bucket 2: 6,2,9,6=23
bucket 3: 7,7,5,4=23
*Question:*How do I write a rule for this:
for each bucket, penalize (with soft scores) a bucket whose total
entity.weight differs from the average total entity.weight of the buckets.
Will I get the same results when I penalize each bucket for differing with
*each other*?
--
View this message in context: http://drools.46999.n3.nabble.com/How-to-even-out-n-buckets-in-Drools-Pla...
Sent from the Drools: User forum mailing list archive at Nabble.com.
12 years, 10 months