Expert 5.2.Final
My data comes to me as all strings, but I sometimes need to convert some
fields into integers in order to test their value. I wanted to avoid
conversion errors, so I combined rules into an activation-group and used
salience to control the order. However, at runtime I am getting a number
format error in method underWritingClassAsInt. I don't understand why - can
you explain?
rule "XmLifeParticipant underWritingClass Validation"
activation-group "XmLifeParticipant-underWritingClass"
salience 100
when
$lp : XmLifeParticipant(fieldWasModified("underWritingClass")
&& underWritingClass not matches "^\\d$" )
then
$lp.addError(drools.getRule().getName());
end
rule "XmLifeParticipant underWritingClass Value Check"
activation-group "XmLifeParticipant-underWritingClass"
salience 50
when
$lp : XmLifeParticipant(fieldWasModified("underWritingClass")
&& underWritingClassAsInt not in (1, 2, 4, 6))
then
$lp.addError(drools.getRule().getName());
end
--
View this message in context:
http://drools.46999.n3.nabble.com/Salience-activation-group-tp3564649p356...
Sent from the Drools: User forum mailing list archive at
Nabble.com.