I have a question on the return value of a not statement........
I have two fairly large rules in respect to the LHS when declarations.
They are identical except for the fact that in one of them, I am checking to
see if one more object exits, while in the other I am checking to see if it
doesn't exist. It seems silly to try have duplicate rules expressively
typed when this is the only difference. So what i tried to do was bind the
value of the not statement as shown below....
rule "Rule Name"
no-loop = true
when
.........
$msg : (or Message (description == "OK")
not Message (description == "OK"))
.........
then
if ($msg == null) {
createMessage("OK"); //
}
.... rest of RHS.....
end
I figured if the Message object didn't exist, null would be returned and
assigned to the $msg variable. But it was not. For now I have it
separated into two rules, but logically I would like to combine them, as
every other part of the LHS and RHS match.
Anyone have any suggestions?
--
View this message in context:
http://www.nabble.com/Binding-Not-tp14463587p14463587.html
Sent from the drools - user mailing list archive at
Nabble.com.