Thanks for the reply, Edson.
After several hours, I finally tracked down the source of the issue. In one of our rules,
the following appeared as part of the LHS:
$asset_count : Integer(intValue > 3) from accumulate (
Asset
(
// bunch of constraints....
) count())
The use of Integer here instead of Number was the root cause of the thrown exception.
The reason it was so hard to find is because this expression was being evaluated (I'm
guessing) to determine whether the rule should be activated. Thus, even though we were
monitoring activation events as well as insertions, de-activations, firings, etc. we were
never able to see which rule was causing the issue - it would throw before any related
events fired. And even in the debugger, the rule that was causing the exception could not
be identified, as it was not visible from the various nodes and other data structures that
comprise the internals of Drools RETE. At least, not visible to me, a total newbie on the
internals.
Admittedly, this does not match the syntax shown in the Drools manual (which illustrates
it using Number instead of Integer), but it would have been a big time saver if the Drools
parser could have rejected this as a syntax error or alerted us to the questionable usage
in some way. In a rule base of several hundred complex rules, it was a nightmare to find.
I don't know whether you still want a JIRA for this or not, since technically it
resulted from a rules coding error - ??
Thanks again.
Tom Murphy
Business Process Consultant
Wells Fargo HCFG - CORE Deal Decisioning Platform
800 S. Jordan Creek Parkway | West Des Moines, IA 50266
MAC: X2301-01B
Office: 515 324 4853 | Mobile: 941 320 8014
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.
-----Original Message-----
From: rules-users-bounces(a)lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] On
Behalf Of rules-users-request(a)lists.jboss.org
Sent: Tuesday, April 21, 2009 2:57 AM
To: rules-users(a)lists.jboss.org
Subject: rules-users Digest, Vol 29, Issue 59
Send rules-users mailing list submissions to
rules-users(a)lists.jboss.org
To subscribe or unsubscribe via the World Wide Web, visit
or, via email, send a message with subject or body 'help' to
rules-users-request(a)lists.jboss.org
You can reach the person managing the list at
rules-users-owner(a)lists.jboss.org
When replying, please edit your Subject line so it is more specific
than "Re: Contents of rules-users digest..."
Today's Topics:
1. Re: Question: Why is ClassFieldReader.getIntValue throwing
in this scenario? (Edson Tirelli)
2. Re: Drools 3.0.6 - Not able to execute more than one rule -
Stucked up (Vir)
3. Drools 3.0.6 with OC4J (Vir)
4. "==" operator does not work on float and double type (Zeke)
----------------------------------------------------------------------
Message: 1
Date: Mon, 20 Apr 2009 22:05:34 -0400
From: Edson Tirelli <tirelli(a)post.com>
Subject: Re: [rules-users] Question: Why is
ClassFieldReader.getIntValue throwing in this scenario?
To: Rules Users List <rules-users(a)lists.jboss.org>
Message-ID:
<e6dd5ba30904201905t3cf1fe25td9b6a43b9224ba4c(a)mail.gmail.com>
Content-Type: text/plain; charset="windows-1252"
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?
Thanks,
Edson
2009/4/20 <Tom.E.Murphy(a)wellsfargo.com>
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.
*public* *int* getIntValue(InternalWorkingMemory workingMemory,
*final* Object object) {
*return* *this*.reader.getIntValue( workingMemory,
object );
}
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:
*public* *boolean* isAllowed(*final* InternalReadAccessor readAccessor,
*final* InternalFactHandle handle,
*final* InternalWorkingMemory workingMemoiry,
*final* ContextEntry context) {
*return* *this*.evaluator.evaluate( *null*,
*this*.readAccessor,
handle.getObject(),
*this*.field );
}
While sitting on the breakpoint in getIntValue, the live call stack is as
follows:
ClassFieldReader.getIntValue(InternalWorkingMemory, Object) line: 164
ComparableEvaluatorsDefinition$IntegerGreaterEvaluator.evaluate(InternalWorkingMemory,
InternalReadAccessor, Object, FieldValue) line: 1881
LiteralRestriction.isAllowed(InternalReadAccessor, InternalFactHandle,
InternalWorkingMemory, ContextEntry) line: 92
LiteralConstraint.isAllowed(InternalFactHandle, InternalWorkingMemory,
ContextEntry) line: 109
AccumulateNode.evaluateResultConstraints(LeftTuple, PropagationContext,
InternalWorkingMemory, AccumulateNode$AccumulateMemory,
AccumulateNode$AccumulateContext) line: 498
AccumulateNode.assertLeftTuple(LeftTuple, PropagationContext,
InternalWorkingMemory) line: 197
SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(PropagationContext,
InternalWorkingMemory, LeftTuple) line: 117
SingleLeftTupleSinkAdapter.propagateAssertLeftTuple(LeftTuple, RightTuple,
PropagationContext, InternalWorkingMemory, boolean) line: 28
JoinNode.assertObject(InternalFactHandle, PropagationContext,
InternalWorkingMemory) line: 175
CompositeObjectSinkAdapter.doPropagateAssertObject(InternalFactHandle,
PropagationContext, InternalWorkingMemory, ObjectSink) line: 366
CompositeObjectSinkAdapter.propagateAssertObject(InternalFactHandle,
PropagationContext, InternalWorkingMemory) line: 349
AlphaNode.assertObject(InternalFactHandle, PropagationContext,
InternalWorkingMemory) line: 147
SingleObjectSinkAdapter.propagateAssertObject(InternalFactHandle,
PropagationContext, InternalWorkingMemory) line: 42
AlphaNode.assertObject(InternalFactHandle, PropagationContext,
InternalWorkingMemory) line: 147
SingleObjectSinkAdapter.propagateAssertObject(InternalFactHandle,
PropagationContext, InternalWorkingMemory) line: 42
AlphaNode.assertObject(InternalFactHandle, PropagationContext,
InternalWorkingMemory) line: 147
CompositeObjectSinkAdapter.doPropagateAssertObject(InternalFactHandle,
PropagationContext, InternalWorkingMemory, ObjectSink) line: 366
CompositeObjectSinkAdapter.propagateAssertObject(InternalFactHandle,
PropagationContext, InternalWorkingMemory) line: 342
ObjectTypeNode.assertObject(InternalFactHandle, PropagationContext,
InternalWorkingMemory) line: 184
EntryPointNode.assertObject(InternalFactHandle, PropagationContext,
ObjectTypeConf, InternalWorkingMemory) line: 146
ReteooStatefulSession(AbstractWorkingMemory).insert(InternalFactHandle,
Object, Rule, Activation, ObjectTypeConf) line: 1066
ReteooStatefulSession(AbstractWorkingMemory).insert(Object, boolean,
boolean, Rule, Activation) line: 1022
DefaultKnowledgeHelper.insert(Object, boolean) line: 103
DefaultKnowledgeHelper.insert(Object) line: 97
Rule_RS6601_3_2_0.consequence(KnowledgeHelper, TransactionDetail,
FactHandle, Double, FactHandle, DealRiskCategoryEnum$Enum, FactHandle,
ExitStrategyTypeEnum$Enum, FactHandle, Short, FactHandle, Short, FactHandle)
line: 32
Rule_RS6601_3_2_0ConsequenceInvoker.evaluate(KnowledgeHelper,
WorkingMemory) line: 42
DefaultAgenda.fireActivation(Activation) line: 934
DefaultAgenda.fireNextItem(AgendaFilter) line: 885
DefaultAgenda.fireAllRules(AgendaFilter, int) line: 1082
ReteooStatefulSession(AbstractWorkingMemory).fireAllRules(AgendaFilter,
int) line: 682
ReteooStatefulSession(AbstractWorkingMemory).fireAllRules() line: 649
StatefulKnowledgeSessionImpl.fireAllRules() line: 177
RuleBase.runTestCase(LoanFile, String, int, Logger) line: 116
*Tom Murphy
**Business Process Consultant
Wells Fargo HCFG - CORE Deal Decisioning Platform
800 S. Jordan Creek Parkway | West Des Moines, IA 50266
MAC: **X2301-01B
**Office: **515 324 4853** | Mobile: 941 320 8014
**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.*
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
Edson Tirelli
JBoss Drools Core Development
JBoss, a division of Red Hat @