[rules-dev] Drools 3.1.0-M1 rules build 3.0.4 compatibility problems with eval statements

Tom Gonzalez tomgon at nortel.com
Fri Mar 2 09:28:44 EST 2007


These are not primitives.


See from below:
eval( !(checkVspToInstanceRatio( (Integer)$vsp3ocount,
     (Integer)$vsp4ecount, (Integer)$vsp3count, (Integer)$nstacount)) 
 );

     eval ( !(strInStr((String)$shelfsn,(String)$netwksn))

     eval( !(checkDlepNumber( (Integer)$dlepkey, (Integer)$nstakey)) ||
     !(isEvenInteger((Integer)$nstakey))

-----Original Message-----
From: rules-dev-bounces at lists.jboss.org
[mailto:rules-dev-bounces at lists.jboss.org] On Behalf Of Edson Tirelli
Sent: Thursday, March 01, 2007 6:17 PM
To: Rules Dev List
Subject: Re: [rules-dev] Drools 3.1.0-M1 rules build 3.0.4 compatibility
problems with eval statements


   Tom,

   Can you confirm the type of your bound variables? 3.1 does not
autobox primitive types anymore to make for a cleaner and more
performant code...

   []s
   Edson

Michael Neale wrote:

> Hi Tom - its great you are trying this out - once again - coudl you 
> attach enough to repoduce this to a JIRA? It will get added to the 
> integration tests.
>
> There is no fundamental reason why you can't cast like that at all, 
> its certainly not a design constraint, just - SHOCK - a bug ! Say it 
> isn't so !
>
> On 3/2/07, *Tom Gonzalez* <tomgon at nortel.com 
> <mailto:tomgon at nortel.com>> wrote:
>
>     We are in the process of converting from 3.0.4 to 3.1.0-M1 and
>     having problems building rules that have eval statements in them
>     that buil d in 3.0.4 with no problems.
>
>     We are getting rules build errors as follows:
>
>          [java] Feb 28, 2007 5:55:29 PM
>     com.nortel.connect.rbuilder.RulePackager build
>          [java] INFO: ============== Start build RulePackage:
>     [engrules.mss] =========
>          [java] Feb 28, 2007 5:55:29 PM
>     com.nortel.connect.rbuilder.RulePackage addRulesFromDrlFile
>          [java] INFO:       adding Rules from: MG15000Rules.drl (with
>     associated DSL)
>          [java] Feb 28, 2007 5:55:29 PM
>     com.nortel.connect.rbuilder.RulePackage addRulesFromDrlFile
>          [java] INFO:       parsed rules using dsl
>         * **[java] org.drools.RuntimeDroolsException: unable to find
>     the function ','*
>          [java]     at
>     
> org.drools.semantics.java.StaticMethodFunctionResolver.resolveFunction
> (StaticMethodFunctionResolver.java:9)
>
>          [java]     at
>
org.drools.semantics.java.FunctionFixer.fix(FunctionFixer.java:132)
>          [java]     at
>
org.drools.semantics.java.FunctionFixer.fix(FunctionFixer.java:103)
>          [java]     at
>     org.drools.semantics.java.FunctionFixer.fix(FunctionFixer.java:66)
>          [java]     at
>     
> org.drools.semantics.java.builder.EvalBuilder.build(EvalBuilder.java:7
> 8)
>
>          [java]     at
>     
> org.drools.semantics.java.builder.GroupElementBuilder.build(GroupEleme
> ntBuilder.java:63)
>
>          [java]     at
>     
> org.drools.semantics.java.builder.GroupElementBuilder.build(GroupEleme
> ntBuilder.java:63)
>
>          [java]     at
>     org.drools.semantics.java.RuleBuilder.build(RuleBuilder.java:178)
>          [java]     at
>
org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:381)
>          [java]     at
>     
> org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:219)
>
>          [java]     at
>     
> com.nortel.connect.rbuilder.RulePackage.addRulesFromDrlFile(RulePackag
> e.java:229)
>
>          [java]     at
>
com.nortel.connect.rbuilder.RulePackager.build(RulePackager.java:206)
>          [java]     at
>     
> com.nortel.connect.rbuilder.RulePackager.buildAll(RulePackager.java:14
> 2)
>
>          [java]     at
>
com.nortel.connect.rbuilder.RulePackager.main(RulePackager.java:92)
>          [java] Feb 28, 2007 5:55:30 PM
>     com.nortel.connect.rbuilder.RulePackage addRulesFromDrlFile
>
>     We have a number of rules with eval's in them such as:
>
>     eval( !(checkVspToInstanceRatio( (Integer)$vsp3ocount,
>     (Integer)$vsp4ecount, (Integer)$vsp3count, (Integer)$nstacount)) 
> );
>
>     eval ( !(strInStr((String)$shelfsn,(String)$netwksn))
>
>     eval( !(checkDlepNumber( (Integer)$dlepkey, (Integer)$nstakey)) ||
>     !(isEvenInteger((Integer)$nstakey))
>
>     The parser has issue with the cast syntax in the eval removing the
>     cast (like (Integer) ) cleans up the paser issue however this is
>     not a feasible solution. Casting is required in some cases with
>     out adding a good bit of extra work.
>
>     Can you restore the support we previously had for casting with in
>     an eval and retain the flexibility of using casts when needed?
>
>     Thanks,
>
>
>     Regards,
>
>     Tom G
>
>
>
>
>
>
>
>     _______________________________________________
>     rules-dev mailing list
>     rules-dev at lists.jboss.org <mailto: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
>  
>


--
 Edson Tirelli
 Software Engineer - JBoss Rules Core Developer
 Office: +55 11 3124-6000
 Mobile: +55 11 9218-4151
 JBoss, a division of Red Hat @ www.jboss.com


_______________________________________________
rules-dev mailing list
rules-dev at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev




More information about the rules-dev mailing list