From dsotty at gmail.com Fri Feb 7 19:13:27 2014 From: dsotty at gmail.com (Davide Sottara) Date: Fri, 7 Feb 2014 16:13:27 -0800 (PST) Subject: [rules-dev] Property reactive broken in 5.5.0 Final In-Reply-To: <1391810529737-4028017.post@n3.nabble.com> References: <1391810529737-4028017.post@n3.nabble.com> Message-ID: <1391818407684-4028018.post@n3.nabble.com> As of today, it seems to be working fine on 6.1.0-SNAPSHOT - both rules fire. If confirmed on 6.0.1, can you please open a ticket? Thanks Davide -- View this message in context: http://drools.46999.n3.nabble.com/Property-reactive-broken-in-5-5-0-Final-tp4021231p4028018.html Sent from the Drools: Developer (committer) mailing list mailing list archive at Nabble.com. From wolfgang.laun at gmail.com Wed Feb 12 13:18:52 2014 From: wolfgang.laun at gmail.com (Wolfgang Laun) Date: Wed, 12 Feb 2014 19:18:52 +0100 Subject: [rules-dev] Fwd: [rules-users] ArrayIndexOutOfBoundsException under high events load in drools CEP In-Reply-To: <52FBB990.2010106@gmail.com> References: <1392128446787-4028071.post@n3.nabble.com> <52FBB990.2010106@gmail.com> Message-ID: IIRC, there were some rather positive statements during the evoluion of 5.x that a session is thread-safe. -W ---------- Forwarded message ---------- From: Davide Sottara Date: Wed, 12 Feb 2014 19:12:32 +0100 Subject: Re: [rules-users] ArrayIndexOutOfBoundsException under high events load in drools CEP To: rules-users at lists.jboss.org I can see a few independent issues here. Drools 5.x was not designed to be thread-safe in general: there are some known critical races that may arise when multiple threads are inserting facts in parallel. Many have been patched in 5.6, but the real solution to the problem will be introduced in the 6.x series. From cognescent at gmail.com Sun Feb 16 13:05:29 2014 From: cognescent at gmail.com (Sebastian Samaruga) Date: Sun, 16 Feb 2014 15:05:29 -0300 Subject: [rules-dev] Semantic Web Drools Module, Request for Feedbak In-Reply-To: <1300956855687-2724355.post@n3.nabble.com> References: <668e00070910182248x497300b1u839dc1fc4603e4bd@mail.gmail.com> <4ADC6AA6.2050902@codehaus.org> <96ab3ced0910191525n25dcb4b3r7ecec019d7c7e354@mail.gmail.com> <4ADCF320.1070808@codehaus.org> <1300956855687-2724355.post@n3.nabble.com> Message-ID: Hi I've recently received an inquiry regarding this outdated thread, Given the focus I'm currently turning on my development, see my googlecode page: http://cognescent.googlecode.com (there is not really much there by the way) you'll see I'm trying to build an underlying framework for BI (Business Intelligence) platforms. My goals are to be able to receive data from any data source, translate it to triples (as much as I can see, any kind of data source is feasible to be translated into triples: relational, NoSQL, XML, etc). Then, given that input triples, infer as much meta data as possible, for example, infer types/classes without any schema information and then build a meta model with this translate-able model to other output models or endpoints. The idea of MDAfy is still fascinating. Maybe, I'm not sure, this could work with Drools in this way: My model has a set of predefined entities which represents semantic / semiotic relationship. Having a set of 'predefined' rules in Drools for each kind of entity for which the meta model provides 'executable' instances, for me sounds like some kind of meta programming that could be done. Drools could be the engine and the meta model and input data could be kind of script. I'm really not sure if something like this could be done, I'm just thinking out loud. Best regards, Sebastian. On Thu, Mar 24, 2011 at 5:54 AM, cognescent wrote: > Hi, > > Maybe I'm a little outdated with this thread. I'm currently developing with > Drools and > found this thread fascinating. > > I really like the idea of using an MDA overlay layer on top of which PSM > models are > generated, and I've found myself trying to do the same regarding facts of > the RuleModel > coming from an ontology in kind of semantic repository for translating them > and importing > them into Guvnor. > > I will be pleased if you let me know if there was some advance regarding > the > integration of > semantics into Drools. My current efforts are actually going to Business > Intelligence through > semantics and think rules engine will really help. > > Something is actually available (concept drafts) at docs sections in > http://cognescent.googlecode.com http://cognescent.googlecode.com > > Regards, > Sebastian. > > > -- > View this message in context: > http://drools-java-rules-engine.46999.n3.nabble.com/Semantic-Web-Drools-Module-Request-for-Feedbak-tp64822p2724355.html > Sent from the Drools - Dev mailing list archive at Nabble.com. > _______________________________________________ > rules-dev mailing list > rules-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/rules-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/rules-dev/attachments/20140216/e46da33c/attachment.html From mproctor at codehaus.org Tue Feb 18 20:49:28 2014 From: mproctor at codehaus.org (Mark Proctor) Date: Wed, 19 Feb 2014 01:49:28 +0000 Subject: [rules-dev] JBoss versioning policy - community 6.1 vs 7.0 Message-ID: I?m providing some information on planned version policy changes within JBoss, that will most likely impact our next community release. Currently the project vs product version numbering is considered confusing by some people; especially when both the project and the product are on the same major version number. One of the ways JBoss wishes to address this is for the community major version to automatically increment just prior to the product release - if the community is on the same version. For example as JBoss BRMS 6.0 is about to release, with community currently also on 6.0 the next community release would be required to move to 7.0, instead of 6.1. Community can then do 7.1, 7.2, 7.3 etc until the product shifts to 7.0. At which point the community much shift to 8.0. Mark From wolfgang.laun at gmail.com Wed Feb 19 04:08:37 2014 From: wolfgang.laun at gmail.com (Wolfgang Laun) Date: Wed, 19 Feb 2014 10:08:37 +0100 Subject: [rules-dev] JBoss versioning policy - community 6.1 vs 7.0 In-Reply-To: References: Message-ID: An absolutely unusual reason for incrementing a major version number, which traditionally is only done when some major change is being made. And I don't think that a difference of 1.0 will make a difference in people's minds. -W On 19/02/2014, Mark Proctor wrote: > I'm providing some information on planned version policy changes within > JBoss, that will most likely impact our next community release. > > Currently the project vs product version numbering is considered confusing > by some people; especially when both the project and the product are on the > same major version number. One of the ways JBoss wishes to address this is > for the community major version to automatically increment just prior to the > product release - if the community is on the same version. For example as > JBoss BRMS 6.0 is about to release, with community currently also on 6.0 the > next community release would be required to move to 7.0, instead of 6.1. > Community can then do 7.1, 7.2, 7.3 etc until the product shifts to 7.0. At > which point the community much shift to 8.0. > > Mark > > > _______________________________________________ > rules-dev mailing list > rules-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/rules-dev > From mproctor at codehaus.org Wed Feb 19 09:19:54 2014 From: mproctor at codehaus.org (Mark Proctor) Date: Wed, 19 Feb 2014 14:19:54 +0000 Subject: [rules-dev] JBoss versioning policy - community 6.1 vs 7.0 In-Reply-To: References: Message-ID: This quote comes to mind: http://www.brainyquote.com/quotes/quotes/a/alfredlord101361.html On Wed, Feb 19, 2014 at 9:08 AM, Wolfgang Laun wrote: > An absolutely unusual reason for incrementing a major version number, > which traditionally is only done when some major change is being made. > > And I don't think that a difference of 1.0 will make a difference in > people's minds. > > -W > > > > > On 19/02/2014, Mark Proctor wrote: > > I'm providing some information on planned version policy changes within > > JBoss, that will most likely impact our next community release. > > > > Currently the project vs product version numbering is considered > confusing > > by some people; especially when both the project and the product are on > the > > same major version number. One of the ways JBoss wishes to address this > is > > for the community major version to automatically increment just prior to > the > > product release - if the community is on the same version. For example as > > JBoss BRMS 6.0 is about to release, with community currently also on 6.0 > the > > next community release would be required to move to 7.0, instead of 6.1. > > Community can then do 7.1, 7.2, 7.3 etc until the product shifts to 7.0. > At > > which point the community much shift to 8.0. > > > > Mark > > > > > > _______________________________________________ > > rules-dev mailing list > > rules-dev at lists.jboss.org > > https://lists.jboss.org/mailman/listinfo/rules-dev > > > _______________________________________________ > rules-dev mailing list > rules-dev at lists.jboss.org > https://lists.jboss.org/mailman/listinfo/rules-dev > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/rules-dev/attachments/20140219/1447631a/attachment.html From mproctor at codehaus.org Tue Feb 25 00:03:18 2014 From: mproctor at codehaus.org (Mark Proctor) Date: Tue, 25 Feb 2014 05:03:18 +0000 Subject: [rules-dev] Rule Engine Detailed Trace Mode Message-ID: For those that don?t know, the new algorithm supports a detailed trace mode. Create a logback.xml and set the level to trace. You?ll then get outputs like the following, which shows you what rules fired and when, and with what amounts of data for each node. It also shows you when rules are linked and unlinked. 2014-02-25 05:00:16,023 [main] DEBUG Starting Engine in PHREAK mode 2014-02-25 05:00:16,084 [main] TRACE Adding Rule R1 2014-02-25 05:00:16,088 [main] TRACE Adding Rule R2 2014-02-25 05:00:16,134 [main] TRACE Insert [fact 0:1:1708041420:1708041420:1:DEFAULT:NON_TRAIT:org.drools.compiler.integrationtests.Misc2Test$Foo at 65cea4cc] 2014-02-25 05:00:16,142 [main] TRACE LinkNode notify=false nmask=1 smask=1 spos=0 rules= 2014-02-25 05:00:16,142 [main] TRACE LinkSegment smask=2 rmask=2 name=R2 2014-02-25 05:00:16,146 [main] TRACE LinkNode notify=true nmask=1 smask=1 spos=0 rules=[RuleMem R1], [RuleMem R2] 2014-02-25 05:00:16,147 [main] TRACE Insert [fact 0:2:281271144:281271144:2:DEFAULT:NON_TRAIT:org.drools.compiler.integrationtests.Misc2Test$Foo2 at 10c3db68] 2014-02-25 05:00:16,148 [main] TRACE BetaNode insert=1 stagedInsertWasEmpty=true 2014-02-25 05:00:16,148 [main] TRACE LinkNode notify=true nmask=2 smask=3 spos=0 rules=[RuleMem R1], [RuleMem R2] 2014-02-25 05:00:16,148 [main] TRACE LinkSegment smask=1 rmask=1 name=R1 2014-02-25 05:00:16,149 [main] TRACE LinkSegment smask=1 rmask=3 name=R2 2014-02-25 05:00:16,149 [main] TRACE LinkRule name=R2 2014-02-25 05:00:16,161 [main] TRACE Queue RuleAgendaItem [Activation rule=R2, act#=0, salience=0, tuple=null] 2014-02-25 05:00:16,161 [main] TRACE Queue Added 1 [Activation rule=R2, act#=0, salience=0, tuple=null] 2014-02-25 05:00:16,161 [main] TRACE Added R2 to eager evaluation list. 2014-02-25 05:00:16,162 [main] TRACE Rule[name=R2] segments=2 TupleSets[insertSize=1, deleteSize=0, updateSize=0] 2014-02-25 05:00:16,162 [main] TRACE 1 [JoinNode(5) - [ClassObjectType class=org.drools.compiler.integrationtests.Misc2Test$Foo2]] TupleSets[insertSize=1, deleteSize=0, updateSize=0] 2014-02-25 05:00:16,163 [main] TRACE Segment 0 2014-02-25 05:00:16,163 [main] TRACE 1 [JoinNode(5) - [ClassObjectType class=org.drools.compiler.integrationtests.Misc2Test$Foo2]] TupleSets[insertSize=1, deleteSize=0, updateSize=0] 2014-02-25 05:00:16,167 [main] TRACE rightTuples TupleSets[insertSize=1, deleteSize=0, updateSize=0] 2014-02-25 05:00:16,168 [main] TRACE Segment 1 2014-02-25 05:00:16,168 [main] TRACE 2 [NotNode(9) - [ClassObjectType class=org.drools.compiler.Person]] TupleSets[insertSize=1, deleteSize=0, updateSize=0] 2014-02-25 05:00:16,169 [main] TRACE Segment 1 2014-02-25 05:00:16,169 [main] TRACE 2 [NotNode(9) - [ClassObjectType class=org.drools.compiler.Person]] TupleSets[insertSize=1, deleteSize=0, updateSize=0] 2014-02-25 05:00:16,169 [main] TRACE rightTuples TupleSets[insertSize=0, deleteSize=0, updateSize=0] 2014-02-25 05:00:16,171 [main] TRACE 3 [RuleTerminalNode(10): rule=R2] TupleSets[insertSize=1, deleteSize=0, updateSize=0] 2014-02-25 05:00:16,171 [main] TRACE Segment 1 2014-02-25 05:00:16,171 [main] TRACE 3 [RuleTerminalNode(10): rule=R2] TupleSets[insertSize=1, deleteSize=0, updateSize=0] 2014-02-25 05:00:16,172 [main] TRACE Fire "R2" [[ R2 active=false ] [ null [fact 0:2:281271144:281271144:2:DEFAULT:NON_TRAIT:org.drools.compiler.integrationtests.Misc2Test$Foo2 at 10c3db68] [fact 0:1:1708041420:1708041420:1:DEFAULT:NON_TRAIT:org.drools.compiler.integrationtests.Misc2Test$Foo at 65cea4cc] ] ] 2014-02-25 05:00:16,177 [main] TRACE Update [fact 0:2:281271144:281271144:3:DEFAULT:NON_TRAIT:org.drools.compiler.integrationtests.Misc2Test$Foo2 at 10c3db68] 2014-02-25 05:00:16,178 [main] TRACE LinkSegment smask=1 rmask=1 name=R1 2014-02-25 05:00:16,178 [main] TRACE LinkSegment smask=1 rmask=3 name=R2 2014-02-25 05:00:16,178 [main] TRACE LinkRule name=R2 2014-02-25 05:00:16,178 [main] TRACE Added R2 to eager evaluation list. 2014-02-25 05:00:16,179 [main] TRACE Insert [fact 0:3:1226345699:-62068830:4:DEFAULT:LEGACY_TRAITABLE:[Person name='null age='0' likes='null']] 2014-02-25 05:00:16,179 [main] TRACE BetaNode insert=1 stagedInsertWasEmpty=true 2014-02-25 05:00:16,179 [main] TRACE LinkNode notify=true nmask=1 smask=1 spos=1 rules=[RuleMem R1] 2014-02-25 05:00:16,180 [main] TRACE LinkSegment smask=2 rmask=3 name=R1 2014-02-25 05:00:16,180 [main] TRACE LinkRule name=R1 2014-02-25 05:00:16,180 [main] TRACE Queue RuleAgendaItem [Activation rule=R1, act#=2, salience=0, tuple=null] 2014-02-25 05:00:16,180 [main] TRACE Queue Added 1 [Activation rule=R1, act#=2, salience=0, tuple=null] 2014-02-25 05:00:16,181 [main] TRACE LinkNode notify=true nmask=1 smask=1 spos=1 rules=[RuleMem R2] 2014-02-25 05:00:16,181 [main] TRACE LinkSegment smask=2 rmask=3 name=R2 2014-02-25 05:00:16,181 [main] TRACE LinkRule name=R2 2014-02-25 05:00:16,181 [main] TRACE Added R2 to eager evaluation list. 2014-02-25 05:00:16,181 [main] TRACE Rule[name=R2] segments=2 TupleSets[insertSize=0, deleteSize=0, updateSize=0] 2014-02-25 05:00:16,182 [main] TRACE 4 [JoinNode(5) - [ClassObjectType class=org.drools.compiler.integrationtests.Misc2Test$Foo2]] TupleSets[insertSize=0, deleteSize=0, updateSize=0] 2014-02-25 05:00:16,182 [main] TRACE Segment 0 2014-02-25 05:00:16,182 [main] TRACE 4 [JoinNode(5) - [ClassObjectType class=org.drools.compiler.integrationtests.Misc2Test$Foo2]] TupleSets[insertSize=0, deleteSize=0, updateSize=0] 2014-02-25 05:00:16,183 [main] TRACE rightTuples TupleSets[insertSize=0, deleteSize=0, updateSize=1] 2014-02-25 05:00:16,183 [main] TRACE Segment 1 2014-02-25 05:00:16,183 [main] TRACE 5 [NotNode(9) - [ClassObjectType class=org.drools.compiler.Person]] TupleSets[insertSize=0, deleteSize=0, updateSize=1] 2014-02-25 05:00:16,184 [main] TRACE Segment 1 2014-02-25 05:00:16,184 [main] TRACE 5 [NotNode(9) - [ClassObjectType class=org.drools.compiler.Person]] TupleSets[insertSize=0, deleteSize=0, updateSize=1] 2014-02-25 05:00:16,184 [main] TRACE rightTuples TupleSets[insertSize=1, deleteSize=0, updateSize=0] 2014-02-25 05:00:16,184 [main] TRACE UnlinkNode notify=true nmask=1 smask=0 spos=1 rules=[RuleMem R2] 2014-02-25 05:00:16,185 [main] TRACE UnlinkSegment smask=2 rmask=1 name=[RuleMem R2] 2014-02-25 05:00:16,185 [main] TRACE UnlinkRule name=R2 2014-02-25 05:00:16,185 [main] TRACE Added R2 to eager evaluation list. 2014-02-25 05:00:16,185 [main] TRACE 6 [RuleTerminalNode(10): rule=R2] TupleSets[insertSize=0, deleteSize=1, updateSize=0] 2014-02-25 05:00:16,186 [main] TRACE Segment 1 2014-02-25 05:00:16,186 [main] TRACE 6 [RuleTerminalNode(10): rule=R2] TupleSets[insertSize=0, deleteSize=1, updateSize=0] 2014-02-25 05:00:16,187 [main] TRACE Rule[name=R2] segments=2 TupleSets[insertSize=0, deleteSize=0, updateSize=0] 2014-02-25 05:00:16,187 [main] TRACE 7 [JoinNode(5) - [ClassObjectType class=org.drools.compiler.integrationtests.Misc2Test$Foo2]] TupleSets[insertSize=0, deleteSize=0, updateSize=0] 2014-02-25 05:00:16,188 [main] TRACE Skip Segment 0 2014-02-25 05:00:16,188 [main] TRACE Segment 1 2014-02-25 05:00:16,188 [main] TRACE 7 [NotNode(9) - [ClassObjectType class=org.drools.compiler.Person]] TupleSets[insertSize=0, deleteSize=0, updateSize=0] 2014-02-25 05:00:16,188 [main] TRACE rightTuples TupleSets[insertSize=0, deleteSize=0, updateSize=0] 2014-02-25 05:00:16,188 [main] TRACE 8 [RuleTerminalNode(10): rule=R2] TupleSets[insertSize=0, deleteSize=0, updateSize=0] 2014-02-25 05:00:16,189 [main] TRACE Segment 1 2014-02-25 05:00:16,189 [main] TRACE 8 [RuleTerminalNode(10): rule=R2] TupleSets[insertSize=0, deleteSize=0, updateSize=0] 2014-02-25 05:00:16,189 [main] TRACE Rule[name=R2] segments=2 TupleSets[insertSize=0, deleteSize=0, updateSize=0] 2014-02-25 05:00:16,189 [main] TRACE 9 [JoinNode(5) - [ClassObjectType class=org.drools.compiler.integrationtests.Misc2Test$Foo2]] TupleSets[insertSize=0, deleteSize=0, updateSize=0] 2014-02-25 05:00:16,190 [main] TRACE Skip Segment 0 2014-02-25 05:00:16,190 [main] TRACE Segment 1 2014-02-25 05:00:16,190 [main] TRACE 9 [NotNode(9) - [ClassObjectType class=org.drools.compiler.Person]] TupleSets[insertSize=0, deleteSize=0, updateSize=0] 2014-02-25 05:00:16,191 [main] TRACE rightTuples TupleSets[insertSize=0, deleteSize=0, updateSize=0] 2014-02-25 05:00:16,191 [main] TRACE 10 [RuleTerminalNode(10): rule=R2] TupleSets[insertSize=0, deleteSize=0, updateSize=0] 2014-02-25 05:00:16,191 [main] TRACE Segment 1 2014-02-25 05:00:16,191 [main] TRACE 10 [RuleTerminalNode(10): rule=R2] TupleSets[insertSize=0, deleteSize=0, updateSize=0] 2014-02-25 05:00:16,192 [main] TRACE Rule[name=R1] segments=2 TupleSets[insertSize=0, deleteSize=0, updateSize=0] 2014-02-25 05:00:16,192 [main] TRACE 11 [JoinNode(5) - [ClassObjectType class=org.drools.compiler.integrationtests.Misc2Test$Foo2]] TupleSets[insertSize=0, deleteSize=0, updateSize=0] 2014-02-25 05:00:16,192 [main] TRACE Skip Segment 0 2014-02-25 05:00:16,192 [main] TRACE Segment 1 2014-02-25 05:00:16,192 [main] TRACE 11 [JoinNode(7) - [ClassObjectType class=org.drools.compiler.Person]] TupleSets[insertSize=0, deleteSize=0, updateSize=1] 2014-02-25 05:00:16,193 [main] TRACE rightTuples TupleSets[insertSize=1, deleteSize=0, updateSize=0] java.lang.NullPointerException at org.drools.core.util.index.LeftTupleIndexHashTable.remove(LeftTupleIndexHashTable.java:386) at org.drools.core.phreak.RuleNetworkEvaluator.doUpdatesReorderLeftMemory(RuleNetworkEvaluator.java:799) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/rules-dev/attachments/20140225/78e77612/attachment-0001.html From mproctor at codehaus.org Tue Feb 25 00:24:56 2014 From: mproctor at codehaus.org (Mark Proctor) Date: Tue, 25 Feb 2014 05:24:56 +0000 Subject: [rules-dev] NullPointerException with LeftTupleIndexHashTable.remove() Message-ID: <9815BD2E-7D84-4677-A713-838C5CCC67CA@codehaus.org> I have managed to reduce down the project from mxv into a single unit test that can be added to Misc2Test. I turned tracing on, and it fails while evaluating R1: 2014-02-25 05:00:16,192 [main] TRACE Rule[name=R1] segments=2 TupleSets[insertSize=0, deleteSize=0, updateSize=0] 2014-02-25 05:00:16,192 [main] TRACE 11 [JoinNode(5) - [ClassObjectType class=org.drools.compiler.integrationtests.Misc2Test$Foo2]] TupleSets[insertSize=0, deleteSize=0, updateSize=0] 2014-02-25 05:00:16,192 [main] TRACE Skip Segment 0 2014-02-25 05:00:16,192 [main] TRACE Segment 1 2014-02-25 05:00:16,192 [main] TRACE 11 [JoinNode(7) - [ClassObjectType class=org.drools.compiler.Person]] TupleSets[insertSize=0, deleteSize=0, updateSize=1] 2014-02-25 05:00:16,193 [main] TRACE rightTuples TupleSets[insertSize=1, deleteSize=0, updateSize=0] I?ve provided the new test and the full trace log below. The problem is the node sharing of Foo2. R1 thinks it?s propagating an update, when it never passed R1?s Foo2 before, so it should propagate as an update for R2 but an insert for R1. I suspect the problem is related to the SegmentPropagator when it is updated after moving from the first shared segment, to the two child segments. Please try to avoid submitting project jars. It takes a lot more time for us to setup and work with, which will delay our time in getting back to you. Ideally create a reduced single test method, as per blow, that is self contained, and submit it with pull request and associated JIRA. see: http://docs.jboss.org/drools/release/5.6.0.Final/droolsjbpm-introduction-docs/html/gettingstarted.html @Test public void testSharedNotWithLeftUpdateAndRightInsert() throws Exception { String str = "import " + Foo.class.getCanonicalName() + ";\n" + "import " + Foo2.class.getCanonicalName() + ";\n" + "import " + Person.class.getCanonicalName() + ";\n" + "rule R1 when\n" + " f1 : Foo( )\n" + " Foo2( )\n" + " Person( age == f1.x )\n" + "then\n" + "end\n" + "rule R2 when\n" + " Foo( )\n" + " f2 : Foo2( )\n" + " not Person()\n" + "then\n" + " modify( f2 ) { x = 3};\n" + " insert( new Person() );\n" + "end\n"; KnowledgeBase kbase = loadKnowledgeBaseFromString(str); StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession(); Foo f1 = new Foo(); Foo2 f2 = new Foo2(); ksession.insert( f1 ); ksession.insert( f2 ); assertEquals(2, ksession.fireAllRules() ); assertEquals( 3, f2.getX() ); } For those interested, here is the full trace output once trace is turned on: 2014-02-25 05:13:33,610 [main] DEBUG Starting Engine in PHREAK mode 2014-02-25 05:13:33,715 [main] TRACE Adding Rule R1 2014-02-25 05:13:33,720 [main] TRACE Adding Rule R2 2014-02-25 05:13:33,809 [main] TRACE Insert [fact 0:1:1668059028:1668059028:1:DEFAULT:NON_TRAIT:org.drools.compiler.integrationtests.Misc2Test$Foo at 636c8f94] 2014-02-25 05:13:33,822 [main] TRACE LinkNode notify=false nmask=1 smask=1 spos=0 rules= 2014-02-25 05:13:33,823 [main] TRACE LinkSegment smask=2 rmask=2 name=R2 2014-02-25 05:13:33,831 [main] TRACE LinkNode notify=true nmask=1 smask=1 spos=0 rules=[RuleMem R1], [RuleMem R2] 2014-02-25 05:13:33,832 [main] TRACE Insert [fact 0:2:588638666:588638666:2:DEFAULT:NON_TRAIT:org.drools.compiler.integrationtests.Misc2Test$Foo2 at 2315e9ca] 2014-02-25 05:13:33,833 [main] TRACE BetaNode insert=1 stagedInsertWasEmpty=true 2014-02-25 05:13:33,833 [main] TRACE LinkNode notify=true nmask=2 smask=3 spos=0 rules=[RuleMem R1], [RuleMem R2] 2014-02-25 05:13:33,833 [main] TRACE LinkSegment smask=1 rmask=1 name=R1 2014-02-25 05:13:33,834 [main] TRACE LinkSegment smask=1 rmask=3 name=R2 2014-02-25 05:13:33,834 [main] TRACE LinkRule name=R2 2014-02-25 05:13:33,855 [main] TRACE Queue RuleAgendaItem [Activation rule=R2, act#=0, salience=0, tuple=null] 2014-02-25 05:13:33,856 [main] TRACE Queue Added 1 [Activation rule=R2, act#=0, salience=0, tuple=null] 2014-02-25 05:13:33,856 [main] TRACE Rule[name=R2] segments=2 TupleSets[insertSize=1, deleteSize=0, updateSize=0] 2014-02-25 05:13:33,856 [main] TRACE 1 [JoinNode(5) - [ClassObjectType class=org.drools.compiler.integrationtests.Misc2Test$Foo2]] TupleSets[insertSize=1, deleteSize=0, updateSize=0] 2014-02-25 05:13:33,857 [main] TRACE Segment 0 2014-02-25 05:13:33,857 [main] TRACE 1 [JoinNode(5) - [ClassObjectType class=org.drools.compiler.integrationtests.Misc2Test$Foo2]] TupleSets[insertSize=1, deleteSize=0, updateSize=0] 2014-02-25 05:13:33,865 [main] TRACE rightTuples TupleSets[insertSize=1, deleteSize=0, updateSize=0] 2014-02-25 05:13:33,867 [main] TRACE Segment 1 2014-02-25 05:13:33,867 [main] TRACE 2 [NotNode(9) - [ClassObjectType class=org.drools.compiler.Person]] TupleSets[insertSize=1, deleteSize=0, updateSize=0] 2014-02-25 05:13:33,867 [main] TRACE Segment 1 2014-02-25 05:13:33,868 [main] TRACE 2 [NotNode(9) - [ClassObjectType class=org.drools.compiler.Person]] TupleSets[insertSize=1, deleteSize=0, updateSize=0] 2014-02-25 05:13:33,868 [main] TRACE rightTuples TupleSets[insertSize=0, deleteSize=0, updateSize=0] 2014-02-25 05:13:33,870 [main] TRACE 3 [RuleTerminalNode(10): rule=R2] TupleSets[insertSize=1, deleteSize=0, updateSize=0] 2014-02-25 05:13:33,871 [main] TRACE Segment 1 2014-02-25 05:13:33,871 [main] TRACE 3 [RuleTerminalNode(10): rule=R2] TupleSets[insertSize=1, deleteSize=0, updateSize=0] 2014-02-25 05:13:33,871 [main] TRACE Fire "R2" [[ R2 active=false ] [ null [fact 0:2:588638666:588638666:2:DEFAULT:NON_TRAIT:org.drools.compiler.integrationtests.Misc2Test$Foo2 at 2315e9ca] [fact 0:1:1668059028:1668059028:1:DEFAULT:NON_TRAIT:org.drools.compiler.integrationtests.Misc2Test$Foo at 636c8f94] ] ] 2014-02-25 05:13:33,877 [main] TRACE Update [fact 0:2:588638666:588638666:3:DEFAULT:NON_TRAIT:org.drools.compiler.integrationtests.Misc2Test$Foo2 at 2315e9ca] 2014-02-25 05:13:33,879 [main] TRACE LinkSegment smask=1 rmask=1 name=R1 2014-02-25 05:13:33,879 [main] TRACE LinkSegment smask=1 rmask=3 name=R2 2014-02-25 05:13:33,879 [main] TRACE LinkRule name=R2 2014-02-25 05:13:33,880 [main] TRACE Insert [fact 0:3:1618732380:-62068830:4:DEFAULT:LEGACY_TRAITABLE:[Person name='null age='0' likes='null']] 2014-02-25 05:13:33,880 [main] TRACE BetaNode insert=1 stagedInsertWasEmpty=true 2014-02-25 05:13:33,880 [main] TRACE LinkNode notify=true nmask=1 smask=1 spos=1 rules=[RuleMem R1] 2014-02-25 05:13:33,880 [main] TRACE LinkSegment smask=2 rmask=3 name=R1 2014-02-25 05:13:33,881 [main] TRACE LinkRule name=R1 2014-02-25 05:13:33,881 [main] TRACE Queue RuleAgendaItem [Activation rule=R1, act#=2, salience=0, tuple=null] 2014-02-25 05:13:33,881 [main] TRACE Queue Added 1 [Activation rule=R1, act#=2, salience=0, tuple=null] 2014-02-25 05:13:33,881 [main] TRACE LinkNode notify=true nmask=1 smask=1 spos=1 rules=[RuleMem R2] 2014-02-25 05:13:33,882 [main] TRACE LinkSegment smask=2 rmask=3 name=R2 2014-02-25 05:13:33,882 [main] TRACE LinkRule name=R2 2014-02-25 05:13:33,882 [main] TRACE Rule[name=R1] segments=2 TupleSets[insertSize=0, deleteSize=0, updateSize=0] 2014-02-25 05:13:33,882 [main] TRACE 4 [JoinNode(5) - [ClassObjectType class=org.drools.compiler.integrationtests.Misc2Test$Foo2]] TupleSets[insertSize=0, deleteSize=0, updateSize=0] 2014-02-25 05:13:33,883 [main] TRACE Segment 0 2014-02-25 05:13:33,883 [main] TRACE 4 [JoinNode(5) - [ClassObjectType class=org.drools.compiler.integrationtests.Misc2Test$Foo2]] TupleSets[insertSize=0, deleteSize=0, updateSize=0] 2014-02-25 05:13:33,884 [main] TRACE rightTuples TupleSets[insertSize=0, deleteSize=0, updateSize=1] 2014-02-25 05:13:33,884 [main] TRACE Segment 1 2014-02-25 05:13:33,884 [main] TRACE 5 [JoinNode(7) - [ClassObjectType class=org.drools.compiler.Person]] TupleSets[insertSize=0, deleteSize=0, updateSize=1] 2014-02-25 05:13:33,884 [main] TRACE Segment 1 2014-02-25 05:13:33,885 [main] TRACE 5 [JoinNode(7) - [ClassObjectType class=org.drools.compiler.Person]] TupleSets[insertSize=0, deleteSize=0, updateSize=1] 2014-02-25 05:13:33,885 [main] TRACE rightTuples TupleSets[insertSize=1, deleteSize=0, updateSize=0] java.lang.NullPointerException at org.drools.core.util.index.LeftTupleIndexHashTable.remove(LeftTupleIndexHashTable.java:386) at org.drools.core.phreak.RuleNetworkEvaluator.doUpdatesReorderLeftMemory(RuleNetworkEvaluator.java:799) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/rules-dev/attachments/20140225/f91e0428/attachment.html From mproctor at codehaus.org Wed Feb 26 10:01:49 2014 From: mproctor at codehaus.org (Mark Proctor) Date: Wed, 26 Feb 2014 15:01:49 +0000 Subject: [rules-dev] NullPointerException with LeftTupleIndexHashTable.remove() In-Reply-To: <9815BD2E-7D84-4677-A713-838C5CCC67CA@codehaus.org> References: <9815BD2E-7D84-4677-A713-838C5CCC67CA@codehaus.org> Message-ID: this is mow fixed in master. Thanks for finding the bug. Please don't forget to make lira's in the future. @mario: Can you paste the jira link you created for this commit in the end. Mark On Tue, Feb 25, 2014 at 5:24 AM, Mark Proctor wrote: > I have managed to reduce down the project from mxv into a single unit test > that can be added to Misc2Test. I turned tracing on, and it fails while > evaluating R1: > 2014-02-25 05:00:16,192 [main] TRACE Rule[name=R1] segments=2 > TupleSets[insertSize=0, deleteSize=0, updateSize=0] > 2014-02-25 05:00:16,192 [main] TRACE 11 [JoinNode(5) - > [ClassObjectType > class=org.drools.compiler.integrationtests.Misc2Test$Foo2]] > TupleSets[insertSize=0, deleteSize=0, updateSize=0] > 2014-02-25 05:00:16,192 [main] TRACE Skip Segment 0 > 2014-02-25 05:00:16,192 [main] TRACE Segment 1 > 2014-02-25 05:00:16,192 [main] TRACE 11 [JoinNode(7) - > [ClassObjectType class=org.drools.compiler.Person]] TupleSets[insertSize=0, > deleteSize=0, updateSize=1] > 2014-02-25 05:00:16,193 [main] TRACE rightTuples > TupleSets[insertSize=1, deleteSize=0, updateSize=0] > I've provided the new test and the full trace log below. > > The problem is the node sharing of Foo2. R1 thinks it's propagating an > update, when it never passed R1's Foo2 before, so it should propagate as an > update for R2 but an insert for R1. I suspect the problem is related to the > SegmentPropagator when it is updated after moving from the first shared > segment, to the two child segments. > > Please try to avoid submitting project jars. It takes a lot more time for > us to setup and work with, which will delay our time in getting back to > you. Ideally create a reduced single test method, as per blow, that is self > contained, and submit it with pull request and associated JIRA. see: > > http://docs.jboss.org/drools/release/5.6.0.Final/droolsjbpm-introduction-docs/html/gettingstarted.html > > > @Test*public void *testSharedNotWithLeftUpdateAndRightInsert() *throws *Exception { String str = *"import " *+ Foo.*class*.getCanonicalName() + *";**\n**" *+ *"import " *+ Foo2.*class*.getCanonicalName() + *";**\n**" *+ *"import " *+ Person.*class*.getCanonicalName() + *";**\n**" *+ *"rule R1 when**\n**" *+ *" f1 : Foo( )**\n**" *+ *" Foo2( )**\n**" *+ *" Person( age == f1.x )**\n**" *+ *"then**\n**" *+ *"end**\n**" *+ *"rule R2 when**\n**" *+ *" Foo( )**\n**" *+ *" f2 : Foo2( )**\n**" *+ *" not Person()**\n**" *+ *"then**\n**" *+ *" modify( f2 ) { x = 3};**\n**" *+ *" insert( new Person() );**\n**" *+ *"end**\n**"*; KnowledgeBase kbase = loadKnowledgeBaseFromString(str); StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession(); Foo f1 = *new *Foo(); Foo2 f2 = *new *Foo2(); ksession.insert( f1 ); ksession.insert( f2 ); *assertEquals*(2, ksession.fireAllRules() ); *assertEquals*( 3, f2.getX() );} > > > For those interested, here is the full trace output once trace is turned > on: > > 2014-02-25 05:13:33,610 [main] DEBUG Starting Engine in PHREAK mode > 2014-02-25 05:13:33,715 [main] TRACE Adding Rule R1 > 2014-02-25 05:13:33,720 [main] TRACE Adding Rule R2 > 2014-02-25 05:13:33,809 [main] TRACE Insert [fact > 0:1:1668059028:1668059028:1:DEFAULT:NON_TRAIT:org.drools.compiler.integrationtests.Misc2Test$Foo at 636c8f94 > ] > 2014-02-25 05:13:33,822 [main] TRACE LinkNode notify=false nmask=1 smask=1 > spos=0 rules= > 2014-02-25 05:13:33,823 [main] TRACE LinkSegment smask=2 rmask=2 name=R2 > 2014-02-25 05:13:33,831 [main] TRACE LinkNode notify=true nmask=1 smask=1 > spos=0 rules=[RuleMem R1], [RuleMem R2] > 2014-02-25 05:13:33,832 [main] TRACE Insert [fact > 0:2:588638666:588638666:2:DEFAULT:NON_TRAIT:org.drools.compiler.integrationtests.Misc2Test$Foo2 at 2315e9ca > ] > 2014-02-25 05:13:33,833 [main] TRACE BetaNode insert=1 > stagedInsertWasEmpty=true > 2014-02-25 05:13:33,833 [main] TRACE LinkNode notify=true nmask=2 smask=3 > spos=0 rules=[RuleMem R1], [RuleMem R2] > 2014-02-25 05:13:33,833 [main] TRACE LinkSegment smask=1 rmask=1 name=R1 > 2014-02-25 05:13:33,834 [main] TRACE LinkSegment smask=1 rmask=3 name=R2 > 2014-02-25 05:13:33,834 [main] TRACE LinkRule name=R2 > 2014-02-25 05:13:33,855 [main] TRACE Queue RuleAgendaItem [Activation > rule=R2, act#=0, salience=0, tuple=null] > 2014-02-25 05:13:33,856 [main] TRACE Queue Added 1 [Activation rule=R2, > act#=0, salience=0, tuple=null] > 2014-02-25 05:13:33,856 [main] TRACE Rule[name=R2] segments=2 > TupleSets[insertSize=1, deleteSize=0, updateSize=0] > 2014-02-25 05:13:33,856 [main] TRACE 1 [JoinNode(5) - > [ClassObjectType > class=org.drools.compiler.integrationtests.Misc2Test$Foo2]] > TupleSets[insertSize=1, deleteSize=0, updateSize=0] > 2014-02-25 05:13:33,857 [main] TRACE Segment 0 > 2014-02-25 05:13:33,857 [main] TRACE 1 [JoinNode(5) - > [ClassObjectType > class=org.drools.compiler.integrationtests.Misc2Test$Foo2]] > TupleSets[insertSize=1, deleteSize=0, updateSize=0] > 2014-02-25 05:13:33,865 [main] TRACE rightTuples > TupleSets[insertSize=1, deleteSize=0, updateSize=0] > 2014-02-25 05:13:33,867 [main] TRACE Segment 1 > 2014-02-25 05:13:33,867 [main] TRACE 2 [NotNode(9) - > [ClassObjectType class=org.drools.compiler.Person]] TupleSets[insertSize=1, > deleteSize=0, updateSize=0] > 2014-02-25 05:13:33,867 [main] TRACE Segment 1 > 2014-02-25 05:13:33,868 [main] TRACE 2 [NotNode(9) - > [ClassObjectType class=org.drools.compiler.Person]] TupleSets[insertSize=1, > deleteSize=0, updateSize=0] > 2014-02-25 05:13:33,868 [main] TRACE rightTuples > TupleSets[insertSize=0, deleteSize=0, updateSize=0] > 2014-02-25 05:13:33,870 [main] TRACE 3 [RuleTerminalNode(10): > rule=R2] TupleSets[insertSize=1, deleteSize=0, updateSize=0] > 2014-02-25 05:13:33,871 [main] TRACE Segment 1 > 2014-02-25 05:13:33,871 [main] TRACE 3 [RuleTerminalNode(10): > rule=R2] TupleSets[insertSize=1, deleteSize=0, updateSize=0] > 2014-02-25 05:13:33,871 [main] TRACE Fire "R2" > [[ R2 active=false ] [ null > [fact > 0:2:588638666:588638666:2:DEFAULT:NON_TRAIT:org.drools.compiler.integrationtests.Misc2Test$Foo2 at 2315e9ca > ] > [fact > 0:1:1668059028:1668059028:1:DEFAULT:NON_TRAIT:org.drools.compiler.integrationtests.Misc2Test$Foo at 636c8f94] > ] ] > 2014-02-25 05:13:33,877 [main] TRACE Update [fact > 0:2:588638666:588638666:3:DEFAULT:NON_TRAIT:org.drools.compiler.integrationtests.Misc2Test$Foo2 at 2315e9ca > ] > 2014-02-25 05:13:33,879 [main] TRACE LinkSegment smask=1 rmask=1 name=R1 > 2014-02-25 05:13:33,879 [main] TRACE LinkSegment smask=1 rmask=3 name=R2 > 2014-02-25 05:13:33,879 [main] TRACE LinkRule name=R2 > 2014-02-25 05:13:33,880 [main] TRACE Insert [fact > 0:3:1618732380:-62068830:4:DEFAULT:LEGACY_TRAITABLE:[Person name='null > age='0' likes='null']] > 2014-02-25 05:13:33,880 [main] TRACE BetaNode insert=1 > stagedInsertWasEmpty=true > 2014-02-25 05:13:33,880 [main] TRACE LinkNode notify=true nmask=1 smask=1 > spos=1 rules=[RuleMem R1] > 2014-02-25 05:13:33,880 [main] TRACE LinkSegment smask=2 rmask=3 name=R1 > 2014-02-25 05:13:33,881 [main] TRACE LinkRule name=R1 > 2014-02-25 05:13:33,881 [main] TRACE Queue RuleAgendaItem [Activation > rule=R1, act#=2, salience=0, tuple=null] > 2014-02-25 05:13:33,881 [main] TRACE Queue Added 1 [Activation rule=R1, > act#=2, salience=0, tuple=null] > 2014-02-25 05:13:33,881 [main] TRACE LinkNode notify=true nmask=1 smask=1 > spos=1 rules=[RuleMem R2] > 2014-02-25 05:13:33,882 [main] TRACE LinkSegment smask=2 rmask=3 name=R2 > 2014-02-25 05:13:33,882 [main] TRACE LinkRule name=R2 > 2014-02-25 05:13:33,882 [main] TRACE Rule[name=R1] segments=2 > TupleSets[insertSize=0, deleteSize=0, updateSize=0] > 2014-02-25 05:13:33,882 [main] TRACE 4 [JoinNode(5) - > [ClassObjectType > class=org.drools.compiler.integrationtests.Misc2Test$Foo2]] > TupleSets[insertSize=0, deleteSize=0, updateSize=0] > 2014-02-25 05:13:33,883 [main] TRACE Segment 0 > 2014-02-25 05:13:33,883 [main] TRACE 4 [JoinNode(5) - > [ClassObjectType > class=org.drools.compiler.integrationtests.Misc2Test$Foo2]] > TupleSets[insertSize=0, deleteSize=0, updateSize=0] > 2014-02-25 05:13:33,884 [main] TRACE rightTuples > TupleSets[insertSize=0, deleteSize=0, updateSize=1] > 2014-02-25 05:13:33,884 [main] TRACE Segment 1 > 2014-02-25 05:13:33,884 [main] TRACE 5 [JoinNode(7) - > [ClassObjectType class=org.drools.compiler.Person]] TupleSets[insertSize=0, > deleteSize=0, updateSize=1] > 2014-02-25 05:13:33,884 [main] TRACE Segment 1 > 2014-02-25 05:13:33,885 [main] TRACE 5 [JoinNode(7) - > [ClassObjectType class=org.drools.compiler.Person]] TupleSets[insertSize=0, > deleteSize=0, updateSize=1] > 2014-02-25 05:13:33,885 [main] TRACE rightTuples > TupleSets[insertSize=1, deleteSize=0, updateSize=0] > > java.lang.NullPointerException > at > org.drools.core.util.index.LeftTupleIndexHashTable.remove(LeftTupleIndexHashTable.java:386) > at > org.drools.core.phreak.RuleNetworkEvaluator.doUpdatesReorderLeftMemory(RuleNetworkEvaluator.java:799) > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.jboss.org/pipermail/rules-dev/attachments/20140226/ae31e32d/attachment-0001.html