-
1. Re: how to return multiple results using single variable of my bean.
laoma036912 Oct 22, 2012 10:43 AM (in response to avneesh)1 of 1 people found this helpfulHi,
It fire rule 2 ,PintsCalculated=2 , then fire rule 3, PointsCalculated =2. they are two different objects.
In my opinion, the fact0 should be the Global variable. as follows:
global packageName.AffiliateRankingDataBean ardb;
rule 1
when
AffiliateRankingDataBean( noOfPoliciesSold == 1)
then
ardb.setPointsCalculated(ardb.getPointsCalculated()+1);
end
rule 2
when
AffiliateRankingDataBean( noOfPoliciesSold == 2)
then
ardb.setPointsCalculated(ardb.getPointsCalculated()+2);
end
rule 3
when
AffiliateRankingDataBean( totalPremium < 300000)
then
ardb.setPointsCalculated(ardb.getPointsCalculated()+2);
endCreate ardb in the code :
AffiliateRankingDataBean ardb=new AffiliateRankingDataBean();
session.setGlobal(ardb);