drl execution problem
by arup
i have one drl like below:
rule "FirstNameDifference"
no-loop true
lock-on-active true
when
person1: Person( $firstName1: firstName )
person2: Person( firstName != $firstName1 )
then
dataDifferenceVO.getDataDiffArray().add("Person/FirstName");
end
i'm passing a list of objects in which i have 2 person type objects. my aim
is to check if the firstnames are same or different. if its different i need
to add one String to the DataDiffArray that is declared inside
DataDifferenceVO class.
but as i pass 2 person objects in the WM the rule is getting executed twice.
i.e, the string "Person/FirstName" is getting added twice in the array list.
why is this happening?... the rule should compare 2 firstnames and return
one String...is not that?... what step should i take to achive what i
want....
Thanks a lot i advance... :) :) :)
--
View this message in context: http://drools.46999.n3.nabble.com/drl-execution-problem-tp3866929p3866929...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 2 months
Interface and @key in declare
by Findulas
Hello,
I want to declare a new fact base on an interface, f.e.: (i leave away all
those publics)
interface BoInterface {
int getId();
void setId(int id);
}
when i declare the fact
declare BoFact (
bo : BoInterface @key
)
the system throws an exception the a class is expected but an interface is
found, when trying to
perform the equals method.
Is there a restriction that @key cannot be used in a declare?
Greetings,
Bernd
--
View this message in context: http://drools.46999.n3.nabble.com/Interface-and-key-in-declare-tp3868085p...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 2 months
ClassCastException when comparing date type with literal
by Zeke
Hi, guys:
I meet a strange issue and need your help again... I am using Drools
4.0.7.
When my rule condition is as *Message( date > "Mar-01-2012" )*,
everything is OK. But if I change it to be as below:
*$msg : Message()
Order ( $msg.date > "Mar-01-2012" )*
I will meet "java.lang.String cannot be cast to java.util.Date"
ClassCastException. "Order" is another fact. I attach the exception call
stack. Please check it. It looks like a bug to me. Do we fix it in later
release? If so, can you tell me which release contains the fix? Thanks!
14 years, 2 months