[rules-users] Rules called with null references?

Robert Crawford crawford at kloognome.com
Thu Nov 3 09:34:43 EDT 2011


I have this rule:

rule "Defrost: Turned On"
when
    $reading : SwitchReading( switchOn == true ) from entry-point
"ReadingsStream"
    not SwitchReading (this.circuit == $reading.circuit, this after $reading
) from entry-point "ReadingsStream"
    not DefrostSwitchOn(this.circuit == $reading.circuit)
then
    LOG.info("Defrost switch turned on by reading '" + $reading + "'.");
    insert(new DefrostSwitchOn($reading));
end

SwitchReading is an event; DefrostSwitchOn is a POJO fact.

Multiple times I've gotten exceptions where this rule's RHS is called with a
null. The ConsequenceExceptionHandler is supposed to list the facts the RHS
was called with, but it's getting an empty list.

Now, I know my system as it currently stands can take a LONG time between
receiving an event and executing the consequence, primarily when it first
starts and is loading its previous known state. It's entirely believable to
me that the event will have expired before the rule's RHS is called. But
shouldn't the event still be referenced by the Activation?



--
View this message in context: http://drools.46999.n3.nabble.com/Rules-called-with-null-references-tp3477164p3477164.html
Sent from the Drools: User forum mailing list archive at Nabble.com.



More information about the rules-users mailing list