If am using a Stateful knowledge session with a rule flow group. I am
inserting into working memory one instance of each class/type listed below.
All of the rules fire except for rule 14. Rule 14 and 15 are very similar
but for some reason only rule 15 fires. If I swap the physical order of 14
and 15 in the DRL file then rule 14 fires and 15 does NOT. If I change the
order of the LHS conditions for rules 14 and 15 then both rules fire. I am
assuming the order of the LHS conditions or physical order of the rules is
irrelevant. Is that the case? If so, then can someone tell me what I’m
doing wrong?
//*******************Classes/Types***********************************
DRuleContext.java (annotated with @PropertyReactive):
boolean elig;
Date date;
Person.java
String typeID;
String status;
DDE (declared type in Drools. Annotated with @propertyReactive)
drvYear : Integer;
drvStartYear: Integer;
drvEndYear : Integer;
//**********************RULES*****************************************
rule "2"
ruleflow-group "MyGroup"
date-effective "01-Jan-2008"
when
$aPerson : Person( typeID == "AE", status == "S")
$aResponse : DRuleContext()
then
modify ($aResponse) { setElig(true) };
end
rule "12"
ruleflow-group "MyGroup"
date-effective "01-Jan-2008"
when
$aResponse : DRuleContext()
eval(getMonthOfTheDate($aResponse.getDate()) > 6)
$dde : DDE()
then
modify($dde){setDrvYear( getYearOfTheDate($aResponse.getDate()))};
modify($dde){setDrvEndYear ( $dde.getDrvYear() + 1)};
modify($dde){setDrvBeginYear( getYearOfTheDate($aResponse.getDate()))};
end
rule "14"
ruleflow-group "MyGroup"
date-effective "01-Jan-2008"
when
$aResponse : DRuleContext( elig==true)
$dde : DDE( drvBeginYear!=null )
then
modify ($aResponse)
{setFsaStartDate(createDate(07,01,$dde.getDrvBeginPlanYear())) };
end
rule "15"
ruleflow-group "MyGroup"
date-effective "01-Jan-2008"
when
$aResponse : DRuleContext( elig==true)
$dde : DDE( drvEndYear!=null )
then
modify ($aResponse)
{setFsaEndDate(createDate(06,30,$dde.getDrvEndPlanYear())) };
end
--
View this message in context:
http://drools.46999.n3.nabble.com/Rules-not-properly-re-evaluating-in-5-5...
Sent from the Drools: User forum mailing list archive at
Nabble.com.