Hello Guys,<br><br>I'm having a NPE in the ClassFieldExtractor.getValue(InternalWorkingMemory, Object) line: 127 <br><br>It happens while executing the RHS of a rule that modifies one fact and then updates one and retract another.<br>
<br>rule "foo"<br><br>when <br> ...<br>then<br> // apply changes<br> PolicyHelper.makeInPolicy($room, $pRoom.getCompliantRuleId(), <br> $pRoom.getPrefLevel(), ProfileTypeEnum.COMPANY);<br><br> update($room);<br>
retract($pRoom);<br>end<br><br>--<br><br>We're using good old 4.0.7, with ShadowFacts :(<br><br>I tracked down the problem to<br><br><blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;" class="gmail_quote">
FactHandleIndexHashTable$FieldIndexEntry.matches(ReteTuple, int) line: 385 <br></blockquote><br>Where,<br><br><blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;" class="gmail_quote">
this.first.getFactHandle()<br></blockquote><div><br>Returns an invalidated fact handle (a handle of a fact that has been retracted before, I imagine). The NPE happens because invalidated handles have their "object" attribute <br>
set to "null" and the matches method mentioned above does:<br><br><blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;" class="gmail_quote"> public boolean matches(final ReteTuple tuple,<br>
final int tupleHashCode) {<br> return this.hashCode == tupleHashCode && this.index.equal( <u><i>this.first.getFactHandle().getObject()</i></u>,<br> tuple );<br>
</blockquote><div><br><br>Is there something I could do to workaround this problem? Any clue is welcome.<br><br>Thanks,<br>Leo.<br><br><br> </div> </div><br>