<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3243" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><FONT face=Arial><FONT size=2><SPAN
class=666021220-21012008><FONT color=#0000ff> </FONT>I
am</SPAN> trying to get a project that runs in Drools 3 working on Drools
4.<SPAN class=786340619-21012008> </SPAN>Several of the rules in our DRL
file are failing for the same reason, which is described below.<SPAN
class=786340619-21012008> </SPAN>I have searched for documentation where
someone encountered this error, but have found none,<SPAN
class=786340619-21012008> </SPAN>which is why I am writing the
list.</FONT></FONT></DIV>
<DIV>
<P align=left><FONT face=Arial size=2></FONT></P>
<P align=left><FONT face=Arial size=2>Here is a sample rule that
fails:</FONT></P>
<P align=left><FONT face=Arial size=2></FONT></P>
<P align=left><FONT face=Arial size=2>rule 'X'<BR></FONT><FONT face=Arial
size=2>salience 750<BR></FONT><FONT face=Arial size=2>when<BR></FONT><FONT
face=Arial size=2>s : Sensor( source == "Not in File" , TCN matches
"CRM[0-9]+MXFS[0-9]+" )<BR></FONT><FONT face=Arial size=2>then<BR></FONT><FONT
face=Arial size=2>System.out.println("Rule executed: X " );<BR></FONT><FONT
face=Arial size=2>s.setSource("X");<BR></FONT><FONT face=Arial
size=2>System.out.println( "in rule location 2");<BR></FONT><FONT face=Arial
size=2>update(s);<BR></FONT><FONT face=Arial size=2>System.out.println( "in rule
location 3");<BR></FONT><FONT face=Arial size=2>end</FONT></P>
<P align=left><FONT face=Arial size=2></FONT></P>
<P align=left><FONT face=Arial size=2>The rule fails <SPAN
class=666021220-21012008> when </SPAN> the "update(s)<SPAN
class=786340619-21012008>;</SPAN>" statement<SPAN
class=666021220-21012008> is executed, with the
error that a String cannot be converted to a long (stack trace is
below). The Sensor class has several variables. The
last getter method called before the failure returns a
long. </SPAN>The source variable (which is set in the RHS of the
rule) is a String<SPAN class=666021220-21012008> , and the for
source</SPAN> is the 2nd to last getter called.</FONT></P>
<P align=left><FONT face=Arial size=2><SPAN class=786340619-21012008>Does anyone
have an idea why this update statement would fail - why it would be trying to
convert a String to a long?</SPAN></FONT></P>
<P align=left><FONT face=Arial size=2><SPAN class=786340619-21012008>Thank
you,<BR></SPAN></FONT><FONT face=Arial size=2><SPAN
class=786340619-21012008>David Warren</SPAN></FONT></P>
<P align=left><FONT face=Arial size=2></FONT></P>
<P align=left><FONT face=Arial size=2>Stack trace:</FONT></P>
<P align=left><FONT face=Arial size=2>org.drools.RuntimeDroolsException:
Conversion to long not supported from java.lang.String<BR></FONT><FONT
face=Arial size=2>at
org.drools.base.extractors.BaseObjectClassFieldExtractor.getLongValue(BaseObjectClassFieldExtractor.java:106)<BR></FONT><FONT
face=Arial size=2>at
org.drools.base.ClassFieldExtractor.getLongValue(ClassFieldExtractor.java:203)<BR></FONT><FONT
face=Arial size=2>at
org.drools.rule.VariableRestriction$LongVariableContextEntry.updateFromTuple(VariableRestriction.java:284)<BR></FONT><FONT
face=Arial size=2>at
org.drools.common.SingleBetaConstraints.updateFromTuple(SingleBetaConstraints.java:100)<BR></FONT><FONT
face=Arial size=2>at
org.drools.reteoo.JoinNode.assertTuple(JoinNode.java:102)<BR></FONT><FONT
face=Arial size=2>at
org.drools.reteoo.CompositeTupleSinkAdapter.createAndPropagateAssertTuple(CompositeTupleSinkAdapter.java:73)<BR></FONT><FONT
face=Arial size=2>at
org.drools.reteoo.LeftInputAdapterNode.assertObject(LeftInputAdapterNode.java:116)<BR></FONT><FONT
face=Arial size=2>at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:318)<BR></FONT><FONT
face=Arial size=2>at
org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:140)<BR></FONT><FONT
face=Arial size=2>at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:299)<BR></FONT><FONT
face=Arial size=2>at
org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:153)<BR></FONT><FONT
face=Arial size=2>at
org.drools.reteoo.Rete.assertObject(Rete.java:175)<BR></FONT><FONT face=Arial
size=2>at
org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:192)<BR></FONT><FONT
face=Arial size=2>at
org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:71)<BR></FONT><FONT
face=Arial size=2>at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:909)<BR></FONT><FONT
face=Arial size=2>at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:881)<BR></FONT><FONT
face=Arial size=2>at
org.drools.base.DefaultKnowledgeHelper.insert(DefaultKnowledgeHelper.java:67)<BR></FONT><FONT
face=Arial size=2>at
org.drools.base.DefaultKnowledgeHelper.insert(DefaultKnowledgeHelper.java:61)<BR></FONT><FONT
face=Arial size=2>at
com.bah.aims.rules.Rule_X_0.consequence(Rule_X_0.java:32)<BR></FONT><FONT
face=Arial size=2>at
com.bah.aims.rules.Rule_X_0ConsequenceInvoker.evaluate(Rule_X_0ConsequenceInvoker.java:22)<BR></FONT><FONT
face=Arial size=2>at
org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:550)<BR></FONT><FONT
face=Arial size=2>at
org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:514)<BR></FONT><FONT
face=Arial size=2>at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:471)<BR></FONT><FONT
face=Arial size=2>at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:433)<BR></FONT><FONT
face=Arial size=2>at
com.bah.aims.rules.compiler.SensorPairRulesTest.testNotInFileIqcrm(SensorPairRulesTest.java:27)<BR></FONT><FONT
face=Arial size=2>at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)<BR></FONT><FONT face=Arial size=2>at
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)<BR></FONT><FONT
face=Arial size=2>at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)<BR></FONT><FONT face=Arial size=2>at
java.lang.reflect.Method.invoke(Unknown Source)<BR></FONT><FONT face=Arial><FONT
size=2>at junit.framework.TestCase.runTest(TestCase.java:154)<BR><SPAN
class=786340619-21012008>...</SPAN></FONT></FONT></P></DIV>
<DIV align=left><FONT face=Arial size=2></FONT> </DIV></BODY></HTML>