In the below rules I expect Rule2 is fire because I am modifying customer name to mahesh. But when I execute Rule2 is not firing but Rule3 is firing. Am I missing anything here
rule "Rule1"
lock-on-active true
salience 95
when
$c:Customer($customerName:customerName)
then
System.out.println($customerName+" =======2========");
modify($c){
setCustomerName("mahesh");
}
System.out.println($customerName);
end
rule "Rule2"
lock-on-active true
salience 85
when
$c1:Customer($customerName:customerName=="mahesh");
then
System.out.println($customerName+" Rules Name is 1 - " + drools.getRule().getName());
$c1.setCustomerName("mahesh456");
update($c1);
end
rule "Rule3"
lock-on-active true
when
$c:Customer($customerName:customerName)
then
System.out.println($customerName+ "***** ");
end