Inconsistency in the Guvnor rule editor and the Eclipse plugin editor
by Rushabh
Hi I have been trying the eclipse editor and the Guvnor rule editor(Technical
rule) and I see that there are some inconsistencies in them for eg: Lets say
I want to call a Java method call */max/*
In the Guvnor I can write it likewise
import java.lang.*
rule "Java"
when
#conditions
acc:Account()
Account(bal<max(10,15))
then
#actions
System.out.println("Got it");
end
Pay notice to the max method here, if I write the same rule in the Eclipse
editor I will get an error saying that cannot resolve Account.max() method.
I have to include the entire package name even though I include the import
statement like so :
Eclise plugin version
import java.lang.*
rule "JAva"
when
#conditions
acc:Account()
Account(11<java.lang.Math.min(bal,15))
then
#actions
System.out.println("Got it");
end
Can anyone help me understand why this difference in behavior.
Thanks.
--
View this message in context: http://drools.46999.n3.nabble.com/Inconsistency-in-the-Guvnor-rule-editor...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 1 month
Any limitation on the count of properties when declare new class in drl file?
by haoruiqian@gmail.com
Hi,
I encountered a strange problem these days, I declared a new class a.b in drl file using keyword "declare", it has too many properties, larger than 64, then when fire rules, it threw ClassCastException, told me class a.b cannot be casted to a.b, but actually these are same class.
I tried to remove some properties made it less than 64, no CCE when fire rules.
This just happened in my product environment, if I run the rules in a pure drools environment in Eclipse, no exception even the count is larger than 64, anybody know why this happened?
The version of drools we used in our production is 6.0, we forked the code from GitHub, so maybe it's not up to date.
Thanks,
Richie
11 years, 1 month
Multiple calculation on same object
by sriksama
I recently encountered below scenario for a rule. I want to know how to
proceed with the rule design for this.
Class Emp{
beingDate:Date
endDate:Date
}
Rule to determine annual income for the employee based on the given dates:
For dates before 3/5/2003 the hourly rate is $3.5 and annual multiplier is
2100.
For dates after 3/5/2003 the hourly rate changes every year (given data) and
annual multiplier is 2092.
There might be scenarios where begin date is before 3/5/2003 and end date is
after 3/5/2003.
What is the best way to design rules for this scenario.
--
View this message in context: http://drools.46999.n3.nabble.com/Multiple-calculation-on-same-object-tp4...
Sent from the Drools: User forum mailing list archive at Nabble.com.
11 years, 1 month