[
https://issues.jboss.org/browse/JBRULES-3074?page=com.atlassian.jira.plug...
]
Richard Ambridge updated JBRULES-3074:
--------------------------------------
Affects Version/s: 5.2.0.CR1
(was: 5.1.1.FINAL)
Description:
When the attached files are run, a null pointer is thrown
java.lang.NullPointerException
at org.drools.time.impl.JDKTimerService.removeJob(JDKTimerService.java:103)
at org.drools.time.impl.JDKTimerService.removeJob(JDKTimerService.java:103)
at org.drools.common.Scheduler.removeAgendaItem(Scheduler.java:63)
at org.drools.common.DefaultAgenda.removeScheduleItem(DefaultAgenda.java:371)
at org.drools.common.ScheduledAgendaItem.remove(ScheduledAgendaItem.java:90)
at org.drools.reteoo.RuleTerminalNode.retractLeftTuple(RuleTerminalNode.java:253)
at
org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateRetractLeftTuple(SingleLeftTupleSinkAdapter.java:212)
at
org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateRetractLeftTuple(SingleLeftTupleSinkAdapter.java:86)
at org.drools.reteoo.NotNode.propagateRetractLeftTuple(NotNode.java:459)
at org.drools.reteoo.NotNode.assertObject(NotNode.java:154)
at
org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:450)
at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:378)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:134)
at
org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:450)
at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:368)
at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:193)
at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:143)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:332)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:293)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:905)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMe
was:
Using drools with time based rules and saliance, the saliance is not used when firing the
rules
This only happens when multiple objects update at the same time.
e.g. Rule 1 is
salience 1000
dialect "mvel"
when
$i : Item(val==10)
Item(val==11, this after [0s, 1m] $i)
Rule 2 is
salience 1000
dialect "mvel"
when
$i : Item(val==10)
not( Item(val==11, this after [0s,1m] $i))
Rule3 is
salience 100
when
$i : Item(val==11)
Then we insert 3 items with val==10
Rule2 is activated 3 times...
Then we insert an item with val==11
Note, with a val==10 and val==11 in the memory, Rule 1 will activate, and Rule 3 will
activate
However, Rule1 should fire first.. as its saliance is high
For the first item it does, but then the Rule 3 fires before 2nd item does.
Audit log is attached, but summary is
Object inserted (1), Item: val==10
Activation created: Rule 2 (1)
Object inserted (2), Item: val==10
Activation created: Rule 2 (2)
Object inserted (3), Item: val==10
Activation created: Rule 2 (3)
Object inserted (4), Item: val==11
Activation created: Rule 1 (1)
Activation created: Rule 1 (2)
Activation created: Rule 1 (3)
Activation created: Rule 3 (4)
Activation cancelled: Rule 2 (1)
Activation cancelled: Rule 2 (2)
Activation cancelled: Rule 2 (3)
.. here we have 4 activations, 3 for Rule1 (saliance 1000), 1 for Rule3(saliance 100)
Activation executed Rule 1 (1)
Activation executed Rule 3 (4) //WRONG
Activation cancelled: Rule 1 (2)
Activation cancelled: Rule 1 (3)
Activation created: Rule 2 (2)
Activation created: Rule 2 (3)
Note, this works fine in Drools 5.0
In Drools 5.2.0 CR1 a null pointer is thrown (another issue will be logged for that)
https://issues.jboss.org/browse/JBRULES-3073 logged for exactly same test case. Drools
5.1.1 saliance is broken.
Works on Drools 5.0
Fails with NPE on 5.2.0 CR1
Null pointer at
org.drools.time.impl.JDKTimerService.removeJob(JDKTimerService.java:103)
-----------------------------------------------------------------------------------------
Key: JBRULES-3074
URL:
https://issues.jboss.org/browse/JBRULES-3074
Project: Drools
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: drools-core
Affects Versions: 5.2.0.CR1
Environment: Ubuntu
Reporter: Richard Ambridge
Assignee: Mark Proctor
Priority: Blocker
Attachments: DroolsRuleTest.java, Item.java, rule1.drl
When the attached files are run, a null pointer is thrown
java.lang.NullPointerException
at org.drools.time.impl.JDKTimerService.removeJob(JDKTimerService.java:103)
at org.drools.time.impl.JDKTimerService.removeJob(JDKTimerService.java:103)
at org.drools.common.Scheduler.removeAgendaItem(Scheduler.java:63)
at org.drools.common.DefaultAgenda.removeScheduleItem(DefaultAgenda.java:371)
at org.drools.common.ScheduledAgendaItem.remove(ScheduledAgendaItem.java:90)
at
org.drools.reteoo.RuleTerminalNode.retractLeftTuple(RuleTerminalNode.java:253)
at
org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateRetractLeftTuple(SingleLeftTupleSinkAdapter.java:212)
at
org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateRetractLeftTuple(SingleLeftTupleSinkAdapter.java:86)
at org.drools.reteoo.NotNode.propagateRetractLeftTuple(NotNode.java:459)
at org.drools.reteoo.NotNode.assertObject(NotNode.java:154)
at
org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:450)
at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:378)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:134)
at
org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:450)
at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:368)
at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:193)
at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:143)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:332)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:293)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:905)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMe
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira