Reputation: 1189
I am testing infinite loops using Modify keyword.
But it is not re triggering the rule.
Rule 1:
rule "Entitle for promotion"
when
$i: EmployeeFinancialFact(rating==Rating.ONE.getRating())
then
PromotionFact $promotion=new PromotionFact($i.getEmpID(),$i.getEmpName());
insert($promotion);
end
Rule 2:
rule "Print EmployeeFinancialFact name entitled for promotion"
when
$p: PromotionFact()
then
modify($p) {setSentForApproval(true);}
end
I am expecting RHS of rule 2 will re-trigger the rule 2 again but it is getting fired only once.
Can anyone please tell me the reason.
Upvotes: 1
Views: 996
Reputation: 1189
Disable property reactive in Kmodule.xml in Drools 7 by adding following lines:
<configuration>
<property key="drools.propertySpecific" value="ALLOWED"/>
</configuration>
Upvotes: 1
Reputation: 6322
The first obvious question would be if you are sure your rules are indeed getting executed (sounds like a silly question, but it has solved many many issues here in SO).
Some other relevant questions are:
PromotionFact
a java class? or a defined declaration in your DRL? Hope it helps,
Upvotes: 1