[rules-users] Rules called with null references?

Wolfgang Laun wolfgang.laun at gmail.com
Thu Nov 3 10:59:31 EDT 2011


The activation contains fact handles, and one must use
   workingMemory.getObjct( handle )
to obtain the object - at least a consequence exception handler would do
this.

It is debatable whether long delays are in order when an application is
using real-time event processing. Time-stamped inserts should not be done
before the backlog of restoring everything has been completed.

-W

On 3 November 2011 14:34, Robert Crawford <crawford at kloognome.com> wrote:

> 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.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20111103/84551a0e/attachment.html 


More information about the rules-users mailing list