Hi All,
I have a simple CEP test case which I am working through. I am currently getting a
NullPointerException in the Consequence and have no idea why.
Rule:
rule "Param Update Event Rule"
when
$pue : ParameterUpdateEvent(name == "testParam2", $param : param)
from entry-point "ParamUpdateStream"
then
#System.out.println("Param '" + $pue.getName() + "' has
been updated to " + $pue.getValue());
System.out.println("HERE!!! " + $param + " " +
$param.name());
End
Exception & Debug:
OBJECT ASSERTED
value:ie.PocketKings.SystemsManagement.Alerting.ParameterUpdateEvent@1265109 factId: 2
OBJECT RETRACTED
value:ie.PocketKings.SystemsManagement.Alerting.ParameterUpdateEvent@1265109 factId: 2
OBJECT ASSERTED
value:ie.PocketKings.SystemsManagement.Alerting.ParameterUpdateEvent@5e8d7d factId: 3
OBJECT RETRACTED
value:ie.PocketKings.SystemsManagement.Alerting.ParameterUpdateEvent@5e8d7d factId: 3
ACTIVATION CREATED rule:Param Update Event Rule activationId:Param Update Event Rule [4,
0] declarations:
$pue=ie.PocketKings.SystemsManagement.Alerting.ParameterUpdateEvent@19b4748(4);
$param=ie.PocketKings.SystemsManagement.Alerting.Parameter@2431b9(4)
Exception in thread "Thread-3" BEFORE ACTIVATION FIRED rule:Param Update Event
Rule activationId:Param Update Event Rule [4, 0] declarations:
$pue=ie.PocketKings.SystemsManagement.Alerting.ParameterUpdateEvent@19b4748(4);
$param=ie.PocketKings.SystemsManagement.Alerting.Parameter@2431b9(4)
OBJECT RETRACTED
value:ie.PocketKings.SystemsManagement.Alerting.ParameterUpdateEvent@19b4748 factId: 4
OBJECT ASSERTED
value:ie.PocketKings.SystemsManagement.Alerting.ParameterUpdateEvent@19b4748 factId: -1
org.drools.runtime.rule.ConsequenceException: java.lang.NullPointerException
at
org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:23)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:943)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:885)
at org.drools.common.DefaultAgenda.fireUntilHalt(DefaultAgenda.java:1065)
at
org.drools.common.AbstractWorkingMemory.fireUntilHalt(AbstractWorkingMemory.java:701)
at
org.drools.common.AbstractWorkingMemory.fireUntilHalt(AbstractWorkingMemory.java:678)
at
org.drools.impl.StatefulKnowledgeSessionImpl.fireUntilHalt(StatefulKnowledgeSessionImpl.java:195)
at
ie.PocketKings.SystemsManagement.Alerting.SessionRunner.run(SessionRunner.java:13)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at
org.drools.base.ie.PocketKings.SystemsManagement.Alerting.ParameterUpdateEvent6011238$getParam.getValue(Unknown
Source)
at org.drools.base.ClassFieldReader.getValue(ClassFieldReader.java:91)
at org.drools.rule.Declaration.getValue(Declaration.java:244)
at
ie.PocketKings.SystemsManagement.Alerting.Rule_Param_Update_Event_Rule_0ConsequenceInvoker.evaluate(Rule_Param_Update_Event_Rule_0ConsequenceInvoker.java:16)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:934)
... 7 more
OBJECT ASSERTED
value:ie.PocketKings.SystemsManagement.Alerting.ParameterUpdateEvent@19fdbcb factId: 5
Could it be that my Event object is getting destroyed before the consequence is run, is
that what "OBJECT RETRACKED" means in this case?
Thanks
Glenn