<br>   Sounds like a bug... it should be casting to Number instead of Integer. Can you open a JIRA with a test case or a way to reproduce the problem?<br><br>   Thanks,<br>       Edson<br><br><div class="gmail_quote">2009/4/20  <span dir="ltr">&lt;<a href="mailto:Tom.E.Murphy@wellsfargo.com">Tom.E.Murphy@wellsfargo.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">






<div>
<font size="2" face="Calibri, sans-serif">
<div>The following block of code inside org.drools.base.ClassFieldReader is throwing an exception and I don’t quite understand why. Can anyone advise? Thanks in advance.</div>
<div> </div>
<div><font color="#7f0055" size="2" face="Courier New, monospace"><b>public</b><font color="#000000"> </font><b>int</b><font color="#000000"> getIntValue(InternalWorkingMemory workingMemory, </font></font></div>
<div style="padding-left: 36pt; text-indent: 36pt;"><font color="#7f0055" size="2" face="Courier New, monospace"><b>final</b><font color="#000000"> Object object) {</font></font></div>
<div><font size="2" face="Courier New, monospace"><span style="background-color: rgb(192, 192, 192);">        </span><font color="#7f0055"><span style="background-color: rgb(192, 192, 192);"><b>return</b></span></font><span style="background-color: rgb(192, 192, 192);"> </span><font color="#7f0055"><span style="background-color: rgb(192, 192, 192);"><b>this</b></span></font><span style="background-color: rgb(192, 192, 192);">.</span><font color="#0000c0"><span style="background-color: rgb(192, 192, 192);">reader</span></font><span style="background-color: rgb(192, 192, 192);">.getIntValue(
workingMemory,</span> </font></div>
<div style="padding-left: 36pt; text-indent: 36pt;"><font size="2" face="Courier New, monospace">object );</font></div>
<div><font size="2" face="Courier New, monospace">    }</font></div>
<div> </div>
<div>Object is of type Long, with value = 0, when the throw happens, and workingMemory is null (having been explicitly passed in as null by the method two layers up in the stack:</div>
<div> </div>
<div><font color="#7f0055" size="2" face="Courier New, monospace"><b>public</b><font color="#000000"> </font><b>boolean</b><font color="#000000"> isAllowed(</font><b>final</b><font color="#000000"> InternalReadAccessor readAccessor,</font></font></div>

<div><font size="2" face="Courier New, monospace">                             <font color="#7f0055"><b>final</b></font> InternalFactHandle handle,</font></div>
<div><font size="2" face="Courier New, monospace">                             <font color="#7f0055"><b>final</b></font> InternalWorkingMemory workingMemoiry,</font></div>
<div><font size="2" face="Courier New, monospace">                             <font color="#7f0055"><b>final</b></font> ContextEntry context) {</font></div>
<div style="padding-left: 36pt; text-indent: 36pt;"><font color="#7f0055" size="2" face="Courier New, monospace"><span style="background-color: rgb(192, 192, 192);"><b>return</b></span><font color="#000000"><span style="background-color: rgb(192, 192, 192);"> </span></font><span style="background-color: rgb(192, 192, 192);"><b>this</b></span><font color="#000000"><span style="background-color: rgb(192, 192, 192);">.</span></font><font color="#0000c0"><span style="background-color: rgb(192, 192, 192);">evaluator</span></font><font color="#000000"><span style="background-color: rgb(192, 192, 192);">.evaluate(
</span></font><span style="background-color: rgb(192, 192, 192);"><b>null</b></span><font color="#000000"><span style="background-color: rgb(192, 192, 192);">,</span></font></font></div>
<div><font size="2" face="Courier New, monospace">                                        <font color="#7f0055"><b>this</b></font>.<font color="#0000c0">readAccessor</font>,</font></div>
<div><font size="2" face="Courier New, monospace">                                        handle.getObject(),</font></div>
<div><font size="2" face="Courier New, monospace">                                        <font color="#7f0055"><b>this</b></font>.<font color="#0000c0">field</font> );</font></div>
<div><font size="2" face="Courier New, monospace">    }</font></div>
<div> </div>
<div> </div>
<div>While sitting on the breakpoint in getIntValue, the live call stack is as follows:</div>
<div> </div>
<div>ClassFieldReader.getIntValue(InternalWorkingMemory, Object) line: 164   </div>
<div>ComparableEvaluatorsDefinition$IntegerGreaterEvaluator.evaluate(InternalWorkingMemory, InternalReadAccessor, Object, FieldValue) line: 1881     </div>
<div>LiteralRestriction.isAllowed(InternalReadAccessor, InternalFactHandle, InternalWorkingMemory, ContextEntry) line: 92    </div>
<div>LiteralConstraint.isAllowed(InternalFactHandle, InternalWorkingMemory, ContextEntry) line: 109  </div>
<div>AccumulateNode.evaluateResultConstraints(LeftTuple, PropagationContext, InternalWorkingMemory, AccumulateNode$AccumulateMemory, AccumulateNode$AccumulateContext) line: 498     </div>
<div>AccumulateNode.assertLeftTuple(LeftTuple, PropagationContext, InternalWorkingMemory) line: 197  </div>
<div>SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(PropagationContext, InternalWorkingMemory, LeftTuple) line: 117   </div>
<div>SingleLeftTupleSinkAdapter.propagateAssertLeftTuple(LeftTuple, RightTuple, PropagationContext, InternalWorkingMemory, boolean) line: 28 </div>
<div>JoinNode.assertObject(InternalFactHandle, PropagationContext, InternalWorkingMemory) line: 175  </div>
<div>CompositeObjectSinkAdapter.doPropagateAssertObject(InternalFactHandle, PropagationContext, InternalWorkingMemory, ObjectSink) line: 366 </div>
<div>CompositeObjectSinkAdapter.propagateAssertObject(InternalFactHandle, PropagationContext, InternalWorkingMemory) line: 349       </div>
<div>AlphaNode.assertObject(InternalFactHandle, PropagationContext, InternalWorkingMemory) line: 147 </div>
<div>SingleObjectSinkAdapter.propagateAssertObject(InternalFactHandle, PropagationContext, InternalWorkingMemory) line: 42   </div>
<div>AlphaNode.assertObject(InternalFactHandle, PropagationContext, InternalWorkingMemory) line: 147 </div>
<div>SingleObjectSinkAdapter.propagateAssertObject(InternalFactHandle, PropagationContext, InternalWorkingMemory) line: 42   </div>
<div>AlphaNode.assertObject(InternalFactHandle, PropagationContext, InternalWorkingMemory) line: 147 </div>
<div>CompositeObjectSinkAdapter.doPropagateAssertObject(InternalFactHandle, PropagationContext, InternalWorkingMemory, ObjectSink) line: 366 </div>
<div>CompositeObjectSinkAdapter.propagateAssertObject(InternalFactHandle, PropagationContext, InternalWorkingMemory) line: 342       </div>
<div>ObjectTypeNode.assertObject(InternalFactHandle, PropagationContext, InternalWorkingMemory) line: 184    </div>
<div>EntryPointNode.assertObject(InternalFactHandle, PropagationContext, ObjectTypeConf, InternalWorkingMemory) line: 146    </div>
<div>ReteooStatefulSession(AbstractWorkingMemory).insert(InternalFactHandle, Object, Rule, Activation, ObjectTypeConf) line: 1066    </div>
<div>ReteooStatefulSession(AbstractWorkingMemory).insert(Object, boolean, boolean, Rule, Activation) line: 1022      </div>
<div>DefaultKnowledgeHelper.insert(Object, boolean) line: 103        </div>
<div>DefaultKnowledgeHelper.insert(Object) line: 97  </div>
<div>Rule_RS6601_3_2_0.consequence(KnowledgeHelper, TransactionDetail, FactHandle, Double, FactHandle, DealRiskCategoryEnum$Enum, FactHandle, ExitStrategyTypeEnum$Enum, FactHandle, Short, FactHandle, Short, FactHandle) line: 32  </div>

<div>Rule_RS6601_3_2_0ConsequenceInvoker.evaluate(KnowledgeHelper, WorkingMemory) line: 42   </div>
<div>DefaultAgenda.fireActivation(Activation) line: 934      </div>
<div>DefaultAgenda.fireNextItem(AgendaFilter) line: 885      </div>
<div>DefaultAgenda.fireAllRules(AgendaFilter, int) line: 1082        </div>
<div>ReteooStatefulSession(AbstractWorkingMemory).fireAllRules(AgendaFilter, int) line: 682  </div>
<div>ReteooStatefulSession(AbstractWorkingMemory).fireAllRules() line: 649   </div>
<div>StatefulKnowledgeSessionImpl.fireAllRules() line: 177   </div>
<div>RuleBase.runTestCase(LoanFile, String, int, Logger) line: 116   </div>
<div> </div>
<div> </div>
<div> </div>
<div style="margin-top: 5pt; margin-bottom: 5pt;"><font color="#4f81bd" size="4" face="Cambria, serif"><b>Tom Murphy<br>

</b><font color="#000000" size="2" face="Calibri, sans-serif"><i>Business Process Consultant<br>

Wells Fargo HCFG - CORE Deal Decisioning Platform<br>

800 S. Jordan Creek Parkway | West Des Moines, IA 50266<br>

MAC: </i></font><font color="#ff0000" size="2" face="Calibri, sans-serif"><i><b>X2301-01B<br>

</b></i></font><font color="#000000" size="2" face="Calibri, sans-serif"><b>Office: </b></font><font color="#1f497d" size="2" face="Calibri, sans-serif"><b>515 324 4853</b></font><font color="#000000" size="2" face="Calibri, sans-serif"><b> | Mobile: 941 320
8014<br>

</b></font><font color="#808080" size="1" face="Calibri, sans-serif"><i>This message may contain confidential and/or privileged information.  If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or
take any action based on this message or any information herein.  If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message.  Thank you for your cooperation.</i></font></font></div>

<div> </div>
<div> </div>
<div> </div>
</font>
</div>

<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>  Edson Tirelli<br>  JBoss Drools Core Development<br>  JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>