I'm still using such solution .
Here an example of rule where I nees to set the
originalPropertyValuationLoan :
rule "OriginalPropertyValuationLoan - NbSecuredGaranteeUnderLoan >= 1 -
garantee H - postCode equivalent - initialValue equivalent"
no-loop
salience 970
dialect "mvel"
when
$controlFact : ControlFact(phase == "INITIAL")
$loanEvaluated : loanEvaluated(nbSecuredGaranteeUnderLoan >= 1,
originalPropertyValuationLoan == null)
$loan : loan() from $loanEvaluated.loan
$garantee : garantee(typegarantee.code == "H" , initialValue != null) from
$loan.garantees
$postCodes : Set(size == 1)
from accumulate(
garantee(typegarantee.code == "H", $n :
postCodeInGarantee) from $loan.garantees,
collectSet($n)
)
$garantees : Set(size == 1)
from accumulate(
garantee(typegarantee.code == "H" ||
typegarantee.code == "O", $n : typegarantee.code) from $loan.garantees,
collectSet($n)
)
$initialValue : Set(size == 1)
from accumulate(
garantee(typegarantee.code == "H", $n : initialValue ) from $loan.garantees,
collectSet($n)
)
then
$loanEvaluated.originalPropertyValuationLoan = $garantee.initialValue
update($loanEvaluated)
#System.out.println("OriginalPropertyValuationLoan -
NbSecuredGaranteeUnderLoan > 1 : " +
$loan.loanEvaluated.originalPropertyValuationLoan);
end
In case this rule isn't fired because any of these conditions isn't set, on
update after any other property has been set this rule will be fired again
--
View this message in context:
http://drools.46999.n3.nabble.com/Update-function-usage-for-java-objects-...
Sent from the Drools: User forum mailing list archive at
Nabble.com.