[jboss-svn-commits] JBL Code SVN: r18910 - in labs/jbossrules/trunk: drools-compiler/src/test/resources/org/drools/integrationtests and 5 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Mar 12 21:44:55 EDT 2008


Author: michael.neale at jboss.com
Date: 2008-03-12 21:44:55 -0400 (Wed, 12 Mar 2008)
New Revision: 18910

Added:
   labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/big_decimal_and_literal.drl
Removed:
   labs/jbossrules/trunk/drools-jbrms/build-readme.html
Modified:
   labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/MiscTest.java
   labs/jbossrules/trunk/drools-core/src/main/java/org/drools/base/evaluators/ComparableEvaluatorsDefinition.java
   labs/jbossrules/trunk/drools-core/src/main/java/org/drools/base/evaluators/EqualityEvaluatorsDefinition.java
   labs/jbossrules/trunk/drools-core/src/main/java/org/drools/base/field/BooleanFieldImpl.java
   labs/jbossrules/trunk/drools-core/src/main/java/org/drools/base/field/DoubleFieldImpl.java
   labs/jbossrules/trunk/drools-core/src/main/java/org/drools/base/field/LongFieldImpl.java
   labs/jbossrules/trunk/drools-core/src/main/java/org/drools/base/field/ObjectFieldImpl.java
   labs/jbossrules/trunk/drools-core/src/main/java/org/drools/spi/FieldValue.java
   labs/jbossrules/trunk/drools-jbrms/build.xml
   labs/jbossrules/trunk/drools-jbrms/src/main/java/org/drools/brms/client/decisiontable/GuidedDecisionTableWidget.java
Log:
JBRULES-1428 Better handling of Big number (type coercion)

Modified: labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/MiscTest.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/MiscTest.java	2008-03-13 01:23:11 UTC (rev 18909)
+++ labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/integrationtests/MiscTest.java	2008-03-13 01:44:55 UTC (rev 18910)
@@ -28,6 +28,7 @@
 import java.io.Reader;
 import java.io.StringReader;
 import java.math.BigDecimal;
+import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -697,6 +698,31 @@
                       list.size() );
     }
 
+	public void testBigDecimalIntegerLiteral() throws Exception {
+
+		final PackageBuilder builder = new PackageBuilder();
+		builder.addPackageFromDrl(new InputStreamReader(getClass()
+				.getResourceAsStream("big_decimal_and_literal.drl")));
+		final Package pkg = builder.getPackage();
+
+		final RuleBase ruleBase = getRuleBase();
+		ruleBase.addPackage(pkg);
+		final WorkingMemory workingMemory = ruleBase.newStatefulSession();
+
+		final List list = new ArrayList();
+		workingMemory.setGlobal("list", list);
+
+		final PersonInterface bill = new Person("bill", null, 12);
+		bill.setBigDecimal(new BigDecimal("42"));
+		bill.setBigInteger(new BigInteger("42"));
+
+		workingMemory.insert(bill);
+		workingMemory.fireAllRules();
+
+		assertEquals(6, list.size());
+	}
+
+
     // @FIXME
     public void FIXME_testBigDecimalWithFromAndEval() throws Exception {
         String rule = "package org.test;\n";

Added: labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/big_decimal_and_literal.drl
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/big_decimal_and_literal.drl	                        (rev 0)
+++ labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/big_decimal_and_literal.drl	2008-03-13 01:44:55 UTC (rev 18910)
@@ -0,0 +1,59 @@
+package org.drools.test
+
+import org.drools.Person;
+import java.math.BigDecimal;
+
+global java.util.List list;
+
+rule "BigDec"
+
+	when
+		p: Person(bigDecimal < 100.01)
+	then
+		System.err.println("rule1");
+		list.add( p );
+end
+
+rule "BigInt"
+	when
+		p: Person(bigInteger < 100.1)
+	then
+	System.err.println("rule2");
+		list.add( p );
+end
+
+rule "BigDec2"
+
+	when
+		p: Person(bigDecimal == 42)
+	then
+	System.err.println("rule3");
+		list.add( p );
+end
+
+rule "BigInt2"
+	when
+		p: Person(bigInteger == 42)
+	then
+	System.err.println("rule4");
+		list.add( p );
+end
+
+rule "BigDec3"
+
+	when
+		p: Person(bigDecimal != 100)
+	then
+	System.err.println("rule5");
+		list.add( p );
+end
+
+rule "BigInt3"
+	when
+		p: Person(bigInteger != 100)
+	then
+	System.err.println("rule6");
+		list.add( p );
+end
+
+


Property changes on: labs/jbossrules/trunk/drools-compiler/src/test/resources/org/drools/integrationtests/big_decimal_and_literal.drl
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/base/evaluators/ComparableEvaluatorsDefinition.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/base/evaluators/ComparableEvaluatorsDefinition.java	2008-03-13 01:23:11 UTC (rev 18909)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/base/evaluators/ComparableEvaluatorsDefinition.java	2008-03-13 01:44:55 UTC (rev 18910)
@@ -1,12 +1,12 @@
 /*
  * Copyright 2007 JBoss Inc
- * 
+ *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -37,13 +37,13 @@
 import org.drools.util.DateUtils;
 
 /**
- * This class defines all the comparable built in 
+ * This class defines all the comparable built in
  * evaluators like >, >=, etc.
- * 
+ *
  * @author etirelli
  */
 public class ComparableEvaluatorsDefinition implements EvaluatorDefinition {
-    
+
     private static final String[] SUPPORTED_IDS = { Operator.LESS.getOperatorString(), Operator.LESS_OR_EQUAL.getOperatorString(),
                                                     Operator.GREATER.getOperatorString(), Operator.GREATER_OR_EQUAL.getOperatorString() };
     private EvaluatorCache evaluators = new EvaluatorCache() {
@@ -123,7 +123,7 @@
             addEvaluator( ValueType.PSHORT_TYPE,        Operator.GREATER_OR_EQUAL,    ShortGreaterOrEqualEvaluator.INSTANCE );
         }
     };
-    
+
     /**
      * @inheridDoc
      */
@@ -147,8 +147,8 @@
                                   final String operatorId,
                                   final boolean isNegated,
                                   final String parameterText) {
-        return this.evaluators.getEvaluator( type, 
-                                             Operator.determineOperator( operatorId, 
+        return this.evaluators.getEvaluator( type,
+                                             Operator.determineOperator( operatorId,
                                                                          isNegated ) );
     }
 
@@ -167,14 +167,14 @@
     public boolean supportsType(ValueType type) {
         return this.evaluators.supportsType( type );
     }
-    
+
     /*  *********************************************************
      *           Evaluator Implementations
      *  *********************************************************
      */
     static class BigDecimalLessEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new BigDecimalLessEvaluator();
@@ -191,7 +191,7 @@
                 return false;
             }
             final BigDecimal comp = (BigDecimal) extractor.getValue( workingMemory, object1 );
-            return comp.compareTo( (BigDecimal) object2.getValue() ) < 0;
+            return comp.compareTo( object2.getBigDecimalValue() ) < 0;
         }
 
         public boolean evaluateCachedRight(InternalWorkingMemory workingMemory,
@@ -230,7 +230,7 @@
 
     static class BigDecimalLessOrEqualEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new BigDecimalLessOrEqualEvaluator();
@@ -247,7 +247,7 @@
                 return false;
             }
             final BigDecimal comp = (BigDecimal) extractor.getValue( workingMemory, object1 );
-            return comp.compareTo( (BigDecimal) object2.getValue() ) <= 0;
+            return comp.compareTo( object2.getBigDecimalValue() ) <= 0;
         }
 
         public boolean evaluateCachedRight(InternalWorkingMemory workingMemory,
@@ -286,7 +286,7 @@
 
     static class BigDecimalGreaterEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new BigDecimalGreaterEvaluator();
@@ -303,7 +303,7 @@
                 return false;
             }
             final BigDecimal comp = (BigDecimal) extractor.getValue( workingMemory, object1 );
-            return comp.compareTo( (BigDecimal) object2.getValue() ) > 0;
+            return comp.compareTo( object2.getBigDecimalValue() ) > 0;
         }
 
         public boolean evaluateCachedRight(InternalWorkingMemory workingMemory,
@@ -342,7 +342,7 @@
 
     static class BigDecimalGreaterOrEqualEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long      serialVersionUID = 400L;
         private final static Evaluator INSTANCE         = new BigDecimalGreaterOrEqualEvaluator();
@@ -359,7 +359,7 @@
                 return false;
             }
             final BigDecimal comp = (BigDecimal) extractor.getValue( workingMemory, object1 );
-            return comp.compareTo( (BigDecimal) object2.getValue() ) >= 0;
+            return comp.compareTo( object2.getBigDecimalValue() ) >= 0;
         }
 
         public boolean evaluateCachedRight(InternalWorkingMemory workingMemory,
@@ -398,7 +398,7 @@
 
     static class BigIntegerLessEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new BigIntegerLessEvaluator();
@@ -415,7 +415,7 @@
                 return false;
             }
             final BigInteger comp = (BigInteger) extractor.getValue( workingMemory, object1 );
-            return comp.compareTo( (BigInteger) object2.getValue() ) < 0;
+            return comp.compareTo( object2.getBigIntegerValue() ) < 0;
         }
 
         public boolean evaluateCachedRight(InternalWorkingMemory workingMemory,
@@ -454,7 +454,7 @@
 
     static class BigIntegerLessOrEqualEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new BigIntegerLessOrEqualEvaluator();
@@ -471,7 +471,7 @@
                 return false;
             }
             final BigInteger comp = (BigInteger) extractor.getValue( workingMemory, object1 );
-            return comp.compareTo( (BigInteger) object2.getValue() ) <= 0;
+            return comp.compareTo( object2.getBigIntegerValue() ) <= 0;
         }
 
         public boolean evaluateCachedRight(InternalWorkingMemory workingMemory,
@@ -510,7 +510,7 @@
 
     static class BigIntegerGreaterEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new BigIntegerGreaterEvaluator();
@@ -527,7 +527,7 @@
                 return false;
             }
             final BigInteger comp = (BigInteger) extractor.getValue( workingMemory, object1 );
-            return comp.compareTo( (BigInteger) object2.getValue() ) > 0;
+            return comp.compareTo( object2.getBigIntegerValue() ) > 0;
         }
 
         public boolean evaluateCachedRight(InternalWorkingMemory workingMemory,
@@ -566,7 +566,7 @@
 
     static class BigIntegerGreaterOrEqualEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long      serialVersionUID = 400L;
         private final static Evaluator INSTANCE         = new BigIntegerGreaterOrEqualEvaluator();
@@ -583,7 +583,7 @@
                 return false;
             }
             final BigInteger comp = (BigInteger) extractor.getValue( workingMemory, object1 );
-            return comp.compareTo( (BigInteger) object2.getValue() ) >= 0;
+            return comp.compareTo( object2.getBigIntegerValue() ) >= 0;
         }
 
         public boolean evaluateCachedRight(InternalWorkingMemory workingMemory,
@@ -619,10 +619,10 @@
             return "BigInteger >=";
         }
     }
-    
+
     static class ByteLessEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new ByteLessEvaluator();
@@ -674,7 +674,7 @@
 
     static class ByteLessOrEqualEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new ByteLessOrEqualEvaluator();
@@ -726,7 +726,7 @@
 
     static class ByteGreaterEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new ByteGreaterEvaluator();
@@ -778,7 +778,7 @@
 
     static class ByteGreaterOrEqualEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long      serialVersionUID = 400L;
         private final static Evaluator INSTANCE         = new ByteGreaterOrEqualEvaluator();
@@ -830,7 +830,7 @@
 
     static class CharacterLessEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new CharacterLessEvaluator();
@@ -882,7 +882,7 @@
 
     static class CharacterLessOrEqualEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new CharacterLessOrEqualEvaluator();
@@ -934,7 +934,7 @@
 
     static class CharacterGreaterEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new CharacterGreaterEvaluator();
@@ -986,7 +986,7 @@
 
     static class CharacterGreaterOrEqualEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long      serialVersionUID = 400L;
         private final static Evaluator INSTANCE         = new CharacterGreaterOrEqualEvaluator();
@@ -1038,7 +1038,7 @@
 
     static class DateLessEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new DateLessEvaluator();
@@ -1088,6 +1088,7 @@
             }
             final Date value1 = (Date) extractor1.getValue( workingMemory, object1 );
             final Date value2 = (Date) extractor2.getValue( workingMemory, object2 );
+            if (null == value2) throw new NullPointerException(extractor2.toString());
             return value1.compareTo( value2 ) < 0;
         }
 
@@ -1098,7 +1099,7 @@
 
     static class DateLessOrEqualEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new DateLessOrEqualEvaluator();
@@ -1148,6 +1149,7 @@
             }
             final Date value1 = (Date) extractor1.getValue( workingMemory, object1 );
             final Date value2 = (Date) extractor2.getValue( workingMemory, object2 );
+            if (null == value2) throw new NullPointerException(extractor2.toString());
             return value1.compareTo( value2 ) <= 0;
         }
 
@@ -1158,7 +1160,7 @@
 
     static class DateGreaterEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new DateGreaterEvaluator();
@@ -1208,6 +1210,7 @@
             }
             final Date value1 = (Date) extractor1.getValue( workingMemory, object1 );
             final Date value2 = (Date) extractor2.getValue( workingMemory, object2 );
+            if (null == value2) throw new NullPointerException(extractor2.toString());
             return value1.compareTo( value2 ) > 0;
         }
 
@@ -1218,7 +1221,7 @@
 
     static class DateGreaterOrEqualEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long      serialVersionUID = 400L;
         private final static Evaluator INSTANCE         = new DateGreaterOrEqualEvaluator();
@@ -1268,6 +1271,7 @@
             }
             final Date value1 = (Date) extractor1.getValue( workingMemory, object1 );
             final Date value2 = (Date) extractor2.getValue( workingMemory, object2 );
+            if (null == value2) throw new NullPointerException(extractor2.toString());
             return value1.compareTo( value2 ) >= 0;
         }
 
@@ -1278,7 +1282,7 @@
 
     static class DoubleLessEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new DoubleLessEvaluator();
@@ -1334,7 +1338,7 @@
 
     static class DoubleLessOrEqualEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new DoubleLessOrEqualEvaluator();
@@ -1390,7 +1394,7 @@
 
     static class DoubleGreaterEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new DoubleGreaterEvaluator();
@@ -1446,7 +1450,7 @@
 
     static class DoubleGreaterOrEqualEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long      serialVersionUID = 400L;
         private final static Evaluator INSTANCE         = new DoubleGreaterOrEqualEvaluator();
@@ -1499,10 +1503,10 @@
             return "Double >=";
         }
     }
-    
+
     static class FloatLessEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new FloatLessEvaluator();
@@ -1558,7 +1562,7 @@
 
     static class FloatLessOrEqualEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new FloatLessOrEqualEvaluator();
@@ -1614,7 +1618,7 @@
 
     static class FloatGreaterEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new FloatGreaterEvaluator();
@@ -1670,7 +1674,7 @@
 
     static class FloatGreaterOrEqualEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long      serialVersionUID = 400L;
         private final static Evaluator INSTANCE         = new FloatGreaterOrEqualEvaluator();
@@ -1723,10 +1727,10 @@
             return "Float >=";
         }
     }
-    
+
     static class IntegerLessEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new IntegerLessEvaluator();
@@ -1778,7 +1782,7 @@
 
     static class IntegerLessOrEqualEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new IntegerLessOrEqualEvaluator();
@@ -1830,7 +1834,7 @@
 
     static class IntegerGreaterEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new IntegerGreaterEvaluator();
@@ -1882,7 +1886,7 @@
 
     static class IntegerGreaterOrEqualEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long      serialVersionUID = 400L;
         private final static Evaluator INSTANCE         = new IntegerGreaterOrEqualEvaluator();
@@ -1931,10 +1935,10 @@
             return "Integer >=";
         }
     }
-    
+
     static class LongLessEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new LongLessEvaluator();
@@ -1986,7 +1990,7 @@
 
     static class LongLessOrEqualEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new LongLessOrEqualEvaluator();
@@ -2038,7 +2042,7 @@
 
     static class LongGreaterEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new LongGreaterEvaluator();
@@ -2090,7 +2094,7 @@
 
     static class LongGreaterOrEqualEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long      serialVersionUID = 400L;
         private final static Evaluator INSTANCE         = new LongGreaterOrEqualEvaluator();
@@ -2139,13 +2143,13 @@
             return "Long >=";
         }
     }
-    
+
     static class ObjectLessEvaluator extends BaseEvaluator {
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new ObjectLessEvaluator();
         private static final ObjectComparator comparator = new ObjectComparator();
-        
 
+
         private ObjectLessEvaluator() {
             super( ValueType.OBJECT_TYPE,
                    Operator.LESS );
@@ -2197,7 +2201,7 @@
 
     static class ObjectLessOrEqualEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new ObjectLessOrEqualEvaluator();
@@ -2254,7 +2258,7 @@
 
     static class ObjectGreaterEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new ObjectGreaterEvaluator();
@@ -2311,7 +2315,7 @@
 
     static class ObjectGreaterOrEqualEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new ObjectGreaterOrEqualEvaluator();
@@ -2368,7 +2372,7 @@
 
     static class ShortLessEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long      serialVersionUID = 400L;
         private static final Evaluator INSTANCE         = new ShortLessEvaluator();
@@ -2420,7 +2424,7 @@
 
     static class ShortLessOrEqualEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long      serialVersionUID = 400L;
         private static final Evaluator INSTANCE         = new ShortLessOrEqualEvaluator();
@@ -2472,7 +2476,7 @@
 
     static class ShortGreaterEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long      serialVersionUID = 400L;
         private static final Evaluator INSTANCE         = new ShortGreaterEvaluator();
@@ -2524,7 +2528,7 @@
 
     static class ShortGreaterOrEqualEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long      serialVersionUID = 400L;
         private static final Evaluator INSTANCE         = new ShortGreaterOrEqualEvaluator();
@@ -2574,10 +2578,10 @@
         }
     }
 
-    
+
     protected static class ObjectComparator implements Comparator {
         // this is a stateless object, and so, can be shared among threads
-        // PLEASE: do not add state to it, unless you remove all concurrent 
+        // PLEASE: do not add state to it, unless you remove all concurrent
         // calls to this class instances
 
         public int compare(Object arg0,
@@ -2599,7 +2603,7 @@
                 if( arg1 instanceof Number ) {
                     val1 = ((Number) arg1).longValue();
                 } else if( arg1 instanceof String ) {
-                    val1 = Long.parseLong( ( String ) arg1 ); 
+                    val1 = Long.parseLong( ( String ) arg1 );
                 } else {
                     throw new ClassCastException( "Not possible to convert "+arg1.getClass()+" into a long value to compare it to "+arg0.getClass() );
                 }
@@ -2619,7 +2623,7 @@
                 } catch( NumberFormatException nfe ) {
                     return ( (String) arg0).compareTo( arg1.toString() );
                 }
-                
+
             }
             try {
                 return ((Comparable)arg0).compareTo( arg1 );
@@ -2628,5 +2632,5 @@
             }
         }
     }
-    
+
 }

Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/base/evaluators/EqualityEvaluatorsDefinition.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/base/evaluators/EqualityEvaluatorsDefinition.java	2008-03-13 01:23:11 UTC (rev 18909)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/base/evaluators/EqualityEvaluatorsDefinition.java	2008-03-13 01:44:55 UTC (rev 18910)
@@ -1,12 +1,12 @@
 /*
  * Copyright 2007 JBoss Inc
- * 
+ *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -37,11 +37,11 @@
 /**
  * This class defines the default built in equality
  * evaluators == and !=
- * 
+ *
  * @author etirelli
  */
 public class EqualityEvaluatorsDefinition implements EvaluatorDefinition {
-    
+
     private static final String[] SUPPORTED_IDS = { Operator.EQUAL.getOperatorString(), Operator.NOT_EQUAL.getOperatorString() };
     private EvaluatorCache evaluators = new EvaluatorCache() {
         private static final long serialVersionUID = 4782368623L;
@@ -94,7 +94,7 @@
             addEvaluator( ValueType.STRING_TYPE,        Operator.NOT_EQUAL,     StringNotEqualEvaluator.INSTANCE );
         }
     };
-    
+
     /**
      * @inheridDoc
      */
@@ -137,12 +137,12 @@
     public boolean supportsType(ValueType type) {
         return this.evaluators.supportsType( type );
     }
-    
+
     /*  *********************************************************
      *           Evaluator Implementations
      *  *********************************************************
      */
-    
+
     static class ArrayEqualEvaluator extends BaseEvaluator {
 
         private static final long     serialVersionUID = 400L;
@@ -211,7 +211,7 @@
 
     static class ArrayNotEqualEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new ArrayNotEqualEvaluator();
@@ -278,7 +278,7 @@
 
     static class BigDecimalEqualEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new BigDecimalEqualEvaluator();
@@ -292,7 +292,7 @@
                                 final Extractor extractor,
                                 final Object object1, final FieldValue object2) {
             final Object value1 = extractor.getValue( workingMemory, object1 );
-            final Object value2 = object2.getValue();
+            final Object value2 = object2.getBigDecimalValue();
             if ( value1 == null ) {
                 return value2 == null;
             }
@@ -337,7 +337,7 @@
 
     static class BigDecimalNotEqualEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new BigDecimalNotEqualEvaluator();
@@ -351,7 +351,7 @@
                                 final Extractor extractor,
                                 final Object object1, final FieldValue object2) {
             final Object value1 = extractor.getValue( workingMemory, object1 );
-            final Object value2 = object2.getValue();
+            final Object value2 = object2.getBigDecimalValue();
             if ( value1 == null ) {
                 return value2 != null;
             }
@@ -395,7 +395,7 @@
 
     static class BigIntegerEqualEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new BigIntegerEqualEvaluator();
@@ -409,7 +409,7 @@
                                 final Extractor extractor,
                                 final Object object1, final FieldValue object2) {
             final Object value1 = extractor.getValue( workingMemory, object1 );
-            final Object value2 = object2.getValue();
+            final Object value2 = object2.getBigIntegerValue();
             if ( value1 == null ) {
                 return value2 == null;
             }
@@ -453,7 +453,7 @@
 
     static class BigIntegerNotEqualEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new BigIntegerNotEqualEvaluator();
@@ -467,7 +467,7 @@
                                 final Extractor extractor,
                                 final Object object1, final FieldValue object2) {
             final Object value1 = extractor.getValue( workingMemory, object1 );
-            final Object value2 = object2.getValue();
+            final Object value2 = object2.getBigDecimalValue();
             if ( value1 == null ) {
                 return value2 != null;
             }
@@ -527,7 +527,7 @@
             } else if ( object2.isNull() ) {
                 return false;
             }
-            
+
             return extractor.getBooleanValue( workingMemory, object1 ) == object2.getBooleanValue();
         }
 
@@ -538,7 +538,7 @@
             } else if ( context.isRightNull() ) {
                 return false;
             }
-            
+
             return context.declaration.getExtractor().getBooleanValue( workingMemory, left ) == ((BooleanVariableContextEntry) context).right;
         }
 
@@ -549,7 +549,7 @@
             } else if ( context.isLeftNull() ) {
                 return false;
             }
-            
+
             return context.extractor.getBooleanValue( workingMemory, object2 ) == ((BooleanVariableContextEntry) context).left;
         }
 
@@ -562,7 +562,7 @@
             } else if (extractor2.isNullValue( workingMemory, object2 )) {
                 return false;
             }
-            
+
             return extractor1.getBooleanValue( workingMemory, object1 ) == extractor2.getBooleanValue( workingMemory, object2 );
         }
 
@@ -574,7 +574,7 @@
 
     static class BooleanNotEqualEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new BooleanNotEqualEvaluator();
@@ -592,7 +592,7 @@
             } else if ( object2.isNull() ) {
                 return true;
             }
-            
+
             return extractor.getBooleanValue( workingMemory, object1 ) != object2.getBooleanValue();
         }
 
@@ -613,7 +613,7 @@
             } else if ( context.isLeftNull() ) {
                 return true;
             }
-            
+
             return context.extractor.getBooleanValue( workingMemory, object2 ) != ((BooleanVariableContextEntry) context).left;
         }
 
@@ -626,7 +626,7 @@
             } else if (extractor2.isNullValue( workingMemory, object2 )) {
                 return true;
             }
-            
+
             return extractor1.getBooleanValue( workingMemory, object1 ) != extractor1.getBooleanValue( workingMemory, object2 );
         }
 
@@ -637,7 +637,7 @@
 
     static class ByteEqualEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new ByteEqualEvaluator();
@@ -655,7 +655,7 @@
             } else if ( object2.isNull() ) {
                 return false;
             }
-            
+
             return extractor.getByteValue( workingMemory, object1 ) == object2.getByteValue();
         }
 
@@ -666,7 +666,7 @@
             } else if ( context.isRightNull() ) {
                 return false;
             }
-            
+
             return context.declaration.getExtractor().getByteValue( workingMemory, left ) == ((LongVariableContextEntry) context).right;
         }
 
@@ -677,7 +677,7 @@
             } else if ( context.isLeftNull() ) {
                 return false;
             }
-            
+
             return ((LongVariableContextEntry) context).left == context.extractor.getByteValue( workingMemory, right );
         }
 
@@ -690,7 +690,7 @@
             } else if (extractor2.isNullValue( workingMemory, object2 )) {
                 return false;
             }
-            
+
             return extractor1.getByteValue( workingMemory, object1 ) == extractor2.getByteValue( workingMemory, object2 );
         }
 
@@ -702,7 +702,7 @@
 
     static class ByteNotEqualEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new ByteNotEqualEvaluator();
@@ -720,7 +720,7 @@
             } else if ( object2.isNull() ) {
                 return true;
             }
-            
+
             return extractor.getByteValue( workingMemory, object1 ) != object2.getByteValue();
         }
 
@@ -731,7 +731,7 @@
             } else if ( context.isRightNull() ) {
                 return true;
             }
-            
+
             return context.declaration.getExtractor().getByteValue( workingMemory, left ) != ((LongVariableContextEntry) context).right;
         }
 
@@ -742,7 +742,7 @@
             } else if ( context.isLeftNull() ) {
                 return true;
             }
-            
+
             return ((LongVariableContextEntry) context).left != context.extractor.getByteValue( workingMemory, object2 );
         }
 
@@ -755,7 +755,7 @@
             } else if (extractor2.isNullValue( workingMemory, object2 )) {
                 return true;
             }
-            
+
             return extractor1.getByteValue( workingMemory, object1 ) != extractor2.getByteValue( workingMemory, object2 );
         }
 
@@ -766,7 +766,7 @@
 
     static class CharacterEqualEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new CharacterEqualEvaluator();
@@ -784,7 +784,7 @@
             } else if ( object2.isNull() ) {
                 return false;
             }
-            
+
             return extractor.getCharValue( workingMemory, object1 ) == object2.getCharValue();
         }
 
@@ -795,7 +795,7 @@
             } else if ( context.isRightNull() ) {
                 return false;
             }
-            
+
             return context.declaration.getExtractor().getCharValue( workingMemory, left ) == ((CharVariableContextEntry) context).right;
         }
 
@@ -806,7 +806,7 @@
             } else if ( context.isLeftNull() ) {
                 return false;
             }
-            
+
             return ((CharVariableContextEntry) context).left == context.extractor.getCharValue( workingMemory, right );
         }
 
@@ -819,7 +819,7 @@
             } else if (extractor2.isNullValue( workingMemory, object2 )) {
                 return false;
             }
-            
+
             return extractor1.getCharValue( workingMemory, object1 ) == extractor2.getCharValue( workingMemory, object2 );
         }
 
@@ -830,7 +830,7 @@
 
     static class CharacterNotEqualEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new CharacterNotEqualEvaluator();
@@ -848,7 +848,7 @@
             } else if ( object2.isNull() ) {
                 return true;
             }
-            
+
             return extractor.getCharValue( workingMemory, object1 ) != object2.getCharValue();
         }
 
@@ -859,7 +859,7 @@
             } else if ( context.isRightNull() ) {
                 return true;
             }
-            
+
             return context.declaration.getExtractor().getCharValue( workingMemory, left ) != ((CharVariableContextEntry) context).right;
         }
 
@@ -870,7 +870,7 @@
             } else if ( context.isLeftNull() ) {
                 return true;
             }
-            
+
             return ((CharVariableContextEntry) context).left != context.extractor.getCharValue( workingMemory, right );
         }
 
@@ -883,7 +883,7 @@
             } else if (extractor2.isNullValue( workingMemory, object2 )) {
                 return true;
             }
-            
+
             return extractor1.getCharValue( workingMemory, object1 ) != extractor2.getCharValue( workingMemory, object2 );
         }
 
@@ -894,7 +894,7 @@
 
     static class DateEqualEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new DateEqualEvaluator();
@@ -967,7 +967,7 @@
 
     static class DateNotEqualEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new DateNotEqualEvaluator();
@@ -1039,7 +1039,7 @@
 
     static class DoubleEqualEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new DoubleEqualEvaluator();
@@ -1079,7 +1079,7 @@
             } else if ( context.isLeftNull() ) {
                 return false;
             }
-            
+
             // TODO: we are not handling delta right now... maybe we should
             return ((DoubleVariableContextEntry) context).left == context.extractor.getDoubleValue( workingMemory, right );
         }
@@ -1093,7 +1093,7 @@
             } else if (extractor2.isNullValue( workingMemory, object2 )) {
                 return false;
             }
-            
+
             // TODO: we are not handling delta right now... maybe we should
             return extractor1.getDoubleValue( workingMemory, object1 ) == extractor2.getDoubleValue( workingMemory, object2 );
         }
@@ -1105,7 +1105,7 @@
 
     static class DoubleNotEqualEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new DoubleNotEqualEvaluator();
@@ -1123,7 +1123,7 @@
             } else if ( object2.isNull() ) {
                 return true;
             }
-            
+
             // TODO: we are not handling delta right now... maybe we should
             return extractor.getDoubleValue( workingMemory, object1 ) != object2.getDoubleValue();
         }
@@ -1135,7 +1135,7 @@
             } else if ( context.isRightNull() ) {
                 return true;
             }
-            
+
             // TODO: we are not handling delta right now... maybe we should
             return context.declaration.getExtractor().getDoubleValue( workingMemory, left ) != ((DoubleVariableContextEntry) context).right;
         }
@@ -1147,7 +1147,7 @@
             } else if ( context.isLeftNull() ) {
                 return true;
             }
-            
+
             // TODO: we are not handling delta right now... maybe we should
             return ((DoubleVariableContextEntry) context).left != context.extractor.getDoubleValue( workingMemory, right );
         }
@@ -1161,7 +1161,7 @@
             } else if (extractor2.isNullValue( workingMemory, object2 )) {
                 return true;
             }
-            
+
             // TODO: we are not handling delta right now... maybe we should
             return extractor1.getDoubleValue( workingMemory, object1 ) != extractor2.getDoubleValue( workingMemory, object2 );
         }
@@ -1173,7 +1173,7 @@
 
     static class FactTemplateEqualEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new FactTemplateEqualEvaluator();
@@ -1232,7 +1232,7 @@
 
     static class FactTemplateNotEqualEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new FactTemplateNotEqualEvaluator();
@@ -1287,7 +1287,7 @@
             return "FactTemplate !=";
         }
     }
-    
+
     static class FloatEqualEvaluator extends BaseEvaluator {
 
         private static final long     serialVersionUID = 400L;
@@ -1306,7 +1306,7 @@
             } else if ( object2.isNull() ) {
                 return false;
             }
-            
+
             // TODO: we are not handling delta right now... maybe we should
             return extractor.getFloatValue( workingMemory, object1 ) == object2.getFloatValue();
         }
@@ -1318,7 +1318,7 @@
             } else if ( context.isRightNull() ) {
                 return false;
             }
-            
+
             // TODO: we are not handling delta right now... maybe we should
             return context.declaration.getExtractor().getFloatValue( workingMemory, left ) == ((DoubleVariableContextEntry) context).right;
         }
@@ -1330,7 +1330,7 @@
             } else if ( context.isLeftNull() ) {
                 return false;
             }
-            
+
             // TODO: we are not handling delta right now... maybe we should
             return ((DoubleVariableContextEntry) context).left == context.extractor.getFloatValue( workingMemory, right );
         }
@@ -1344,7 +1344,7 @@
             } else if (extractor2.isNullValue( workingMemory, object2 )) {
                 return false;
             }
-            
+
             // TODO: we are not handling delta right now... maybe we should
             return extractor1.getFloatValue( workingMemory, object1 ) == extractor2.getFloatValue( workingMemory, object2 );
         }
@@ -1356,7 +1356,7 @@
 
     static class FloatNotEqualEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new FloatNotEqualEvaluator();
@@ -1374,7 +1374,7 @@
             } else if ( object2.isNull() ) {
                 return true;
             }
-            
+
             // TODO: we are not handling delta right now... maybe we should
             return extractor.getFloatValue( workingMemory, object1 ) != object2.getFloatValue();
         }
@@ -1386,7 +1386,7 @@
             } else if ( context.isRightNull() ) {
                 return true;
             }
-            
+
             // TODO: we are not handling delta right now... maybe we should
             return context.declaration.getExtractor().getFloatValue( workingMemory, left ) != ((DoubleVariableContextEntry) context).right;
         }
@@ -1398,7 +1398,7 @@
             } else if ( context.isLeftNull() ) {
                 return true;
             }
-            
+
             // TODO: we are not handling delta right now... maybe we should
             return ((DoubleVariableContextEntry) context).left != context.extractor.getFloatValue( workingMemory, right );
         }
@@ -1412,7 +1412,7 @@
             } else if (extractor2.isNullValue( workingMemory, object2 )) {
                 return true;
             }
-            
+
             // TODO: we are not handling delta right now... maybe we should
             return extractor1.getFloatValue( workingMemory, object1 ) != extractor2.getFloatValue( workingMemory, object2 );
         }
@@ -1424,7 +1424,7 @@
 
     static class IntegerEqualEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new IntegerEqualEvaluator();
@@ -1442,7 +1442,7 @@
             } else if ( object2.isNull() ) {
                 return false;
             }
-            
+
             return extractor.getIntValue( workingMemory, object1 ) == object2.getIntValue();
         }
 
@@ -1453,8 +1453,8 @@
             } else if ( context.isRightNull() ) {
                 return false;
             }
-            
-            return context.declaration.getExtractor().getIntValue( workingMemory, left ) == ((LongVariableContextEntry) context).right; 
+
+            return context.declaration.getExtractor().getIntValue( workingMemory, left ) == ((LongVariableContextEntry) context).right;
         }
 
         public boolean evaluateCachedLeft(InternalWorkingMemory workingMemory,
@@ -1464,20 +1464,20 @@
             } else if ( context.isLeftNull() ) {
                 return false;
             }
-            
+
             return context.extractor.getIntValue( workingMemory, object2 ) == ((LongVariableContextEntry) context).left;
         }
 
         public boolean evaluate(InternalWorkingMemory workingMemory,
                                 final Extractor extractor1,
                                 final Object object1,
-                                final Extractor extractor2, final Object object2) {            
+                                final Extractor extractor2, final Object object2) {
             if (extractor1.isNullValue( workingMemory, object1 )) {
                 return extractor2.isNullValue( workingMemory, object2 );
             } else if (extractor2.isNullValue( workingMemory, object2 )) {
                 return false;
             }
-            
+
             return extractor1.getIntValue( workingMemory, object1 ) == extractor2.getIntValue( workingMemory, object2 );
         }
 
@@ -1489,7 +1489,7 @@
 
     static class IntegerNotEqualEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new IntegerNotEqualEvaluator();
@@ -1501,13 +1501,13 @@
 
         public boolean evaluate(InternalWorkingMemory workingMemory,
                                 final Extractor extractor,
-                                final Object object1, final FieldValue object2) {                     
+                                final Object object1, final FieldValue object2) {
             if ( extractor.isNullValue( workingMemory, object1 ) ) {
                 return !object2.isNull();
             } else if ( object2.isNull() ) {
                 return true;
             }
-            
+
             return extractor.getIntValue( workingMemory, object1 ) != object2.getIntValue();
         }
 
@@ -1518,7 +1518,7 @@
             } else if ( context.isRightNull() ) {
                 return true;
             }
-            
+
             return context.declaration.getExtractor().getIntValue( workingMemory, left ) != ((LongVariableContextEntry) context).right;
         }
 
@@ -1529,7 +1529,7 @@
             } else if ( context.isLeftNull() ) {
                 return true;
             }
-            
+
             return context.extractor.getIntValue( workingMemory, object2 ) != ((LongVariableContextEntry) context).left;
         }
 
@@ -1542,7 +1542,7 @@
             } else if (extractor2.isNullValue( workingMemory, object2 )) {
                 return true;
             }
-            
+
             return extractor1.getIntValue( workingMemory, object1 ) != extractor2.getIntValue( workingMemory, object2 );
         }
 
@@ -1553,7 +1553,7 @@
 
     static class LongEqualEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new LongEqualEvaluator();
@@ -1571,7 +1571,7 @@
             } else if ( object2.isNull() ) {
                 return false;
             }
-            
+
             return extractor.getLongValue( workingMemory, object1 ) == object2.getLongValue();
         }
 
@@ -1582,7 +1582,7 @@
             } else if ( context.isRightNull() ) {
                 return false;
             }
-            
+
             return context.declaration.getExtractor().getLongValue( workingMemory, left ) == ((LongVariableContextEntry) context).right;
         }
 
@@ -1593,7 +1593,7 @@
             } else if ( context.isLeftNull() ) {
                 return false;
             }
-            
+
             return ((LongVariableContextEntry) context).left == context.extractor.getLongValue( workingMemory, right );
         }
 
@@ -1606,7 +1606,7 @@
             } else if (extractor2.isNullValue( workingMemory, object2 )) {
                 return false;
             }
-            
+
             return extractor1.getLongValue( workingMemory, object1 ) == extractor2.getLongValue( workingMemory, object2 );
         }
 
@@ -1617,7 +1617,7 @@
 
     static class LongNotEqualEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new LongNotEqualEvaluator();
@@ -1635,7 +1635,7 @@
             } else if ( object2.isNull() ) {
                 return true;
             }
-            
+
             return extractor.getLongValue( workingMemory, object1 ) != object2.getLongValue();
         }
 
@@ -1646,7 +1646,7 @@
             } else if ( context.isRightNull() ) {
                 return true;
             }
-            
+
             return context.declaration.getExtractor().getLongValue( workingMemory, left ) != ((LongVariableContextEntry) context).right;
         }
 
@@ -1657,7 +1657,7 @@
             } else if ( context.isLeftNull() ) {
                 return true;
             }
-            
+
             return ((LongVariableContextEntry) context).left != context.extractor.getLongValue( workingMemory, right );
         }
 
@@ -1670,7 +1670,7 @@
             } else if (extractor2.isNullValue( workingMemory, object2 )) {
                 return true;
             }
-            
+
             return extractor1.getLongValue( workingMemory, object1 ) != extractor2.getLongValue( workingMemory, object2 );
         }
 
@@ -1681,12 +1681,12 @@
 
     static class ObjectEqualEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new ObjectEqualEvaluator();
-        private static final ObjectEqualsComparator comparator = new ObjectEqualsComparator();   
-        
+        private static final ObjectEqualsComparator comparator = new ObjectEqualsComparator();
+
         private ObjectEqualEvaluator() {
             super( ValueType.OBJECT_TYPE,
                    Operator.EQUAL );
@@ -1753,11 +1753,11 @@
 
     static class ObjectNotEqualEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long     serialVersionUID = 400L;
         public final static Evaluator INSTANCE         = new ObjectNotEqualEvaluator();
-        private static final ObjectEqualsComparator comparator = new ObjectEqualsComparator();           
+        private static final ObjectEqualsComparator comparator = new ObjectEqualsComparator();
 
         private ObjectNotEqualEvaluator() {
             super( ValueType.OBJECT_TYPE,
@@ -1824,7 +1824,7 @@
 
     static class ShortEqualEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long      serialVersionUID = 400L;
         private static final Evaluator INSTANCE         = new ShortEqualEvaluator();
@@ -1842,7 +1842,7 @@
             } else if ( object2.isNull() ) {
                 return false;
             }
-            
+
             return extractor.getShortValue( workingMemory, object1 ) == object2.getShortValue();
         }
 
@@ -1853,7 +1853,7 @@
             } else if ( context.isRightNull() ) {
                 return false;
             }
-            
+
             return context.declaration.getExtractor().getShortValue( workingMemory, left ) == ((LongVariableContextEntry) context).right;
         }
 
@@ -1864,7 +1864,7 @@
             } else if ( context.isLeftNull() ) {
                 return false;
             }
-            
+
             return ((LongVariableContextEntry) context).left == context.extractor.getShortValue( workingMemory, right );
         }
 
@@ -1877,7 +1877,7 @@
             } else if (extractor2.isNullValue( workingMemory, object2 )) {
                 return false;
             }
-            
+
             return extractor1.getShortValue( workingMemory, object1 ) == extractor2.getShortValue( workingMemory, object2 );
         }
 
@@ -1888,7 +1888,7 @@
 
     static class ShortNotEqualEvaluator extends BaseEvaluator {
         /**
-         * 
+         *
          */
         private static final long      serialVersionUID = 400L;
         private static final Evaluator INSTANCE         = new ShortNotEqualEvaluator();
@@ -1906,7 +1906,7 @@
             } else if ( object2.isNull() ) {
                 return true;
             }
-            
+
             return extractor.getShortValue( workingMemory, object1 ) != object2.getShortValue();
         }
 
@@ -1917,7 +1917,7 @@
             } else if ( context.isRightNull() ) {
                 return true;
             }
-            
+
             return context.declaration.getExtractor().getShortValue( workingMemory, left ) != ((LongVariableContextEntry) context).right;
         }
 
@@ -1928,7 +1928,7 @@
             } else if ( context.isLeftNull() ) {
                 return true;
             }
-            
+
             return ((LongVariableContextEntry) context).left != context.extractor.getShortValue( workingMemory, right );
         }
 
@@ -1941,7 +1941,7 @@
             } else if (extractor2.isNullValue( workingMemory, object2 )) {
                 return true;
             }
-            
+
             return extractor1.getShortValue( workingMemory, object1 ) != extractor2.getShortValue( workingMemory, object2 );
         }
 
@@ -2087,8 +2087,8 @@
                 } else {
                     throw new ClassCastException( "Not possible to convert "+arg1.getClass()+" into a double value to compare it to "+arg0.getClass() );
                 }
-                return val0 == val1; // in the future we may need to handle rounding errors 
-            } 
+                return val0 == val1; // in the future we may need to handle rounding errors
+            }
             if( arg0 instanceof String ) {
                 return arg0.equals( arg1.toString() );
             }
@@ -2105,6 +2105,6 @@
             return arg0.equals( arg1 );
         }
     }
-    
 
+
 }

Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/base/field/BooleanFieldImpl.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/base/field/BooleanFieldImpl.java	2008-03-13 01:23:11 UTC (rev 18909)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/base/field/BooleanFieldImpl.java	2008-03-13 01:44:55 UTC (rev 18910)
@@ -1,12 +1,12 @@
 /*
  * Copyright 2005 JBoss Inc
- * 
+ *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,6 +16,9 @@
 
 package org.drools.base.field;
 
+import java.math.BigDecimal;
+import java.math.BigInteger;
+
 import org.drools.RuntimeDroolsException;
 import org.drools.spi.FieldValue;
 
@@ -89,7 +92,7 @@
     public int hashCode() {
         return this.value ? 1 : 0;
     }
-    
+
     public boolean isNull() {
         return false;
     }
@@ -113,9 +116,18 @@
     public boolean isCollectionField() {
         return false;
     }
-    
+
     public boolean isStringField() {
         return false;
     }
 
+	public BigDecimal getBigDecimalValue() {
+		throw new RuntimeDroolsException( "Conversion to BigDecimal not supported for type boolean" );
+	}
+
+	public BigInteger getBigIntegerValue() {
+		throw new RuntimeDroolsException( "Conversion to BigInteger not supported for type boolean" );
+	}
+
+
 }

Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/base/field/DoubleFieldImpl.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/base/field/DoubleFieldImpl.java	2008-03-13 01:23:11 UTC (rev 18909)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/base/field/DoubleFieldImpl.java	2008-03-13 01:44:55 UTC (rev 18910)
@@ -1,5 +1,8 @@
 package org.drools.base.field;
 
+import java.math.BigDecimal;
+import java.math.BigInteger;
+
 import org.drools.RuntimeDroolsException;
 import org.drools.spi.FieldValue;
 
@@ -69,7 +72,7 @@
     public int hashCode() {
         return (int) this.value;
     }
-    
+
     public boolean isNull() {
         return false;
     }
@@ -89,7 +92,7 @@
     public boolean isObjectField() {
         return false;
     }
-    
+
     public boolean isCollectionField() {
         return false;
     }
@@ -98,4 +101,12 @@
         return false;
     }
 
+	public BigDecimal getBigDecimalValue() {
+		return new BigDecimal(this.value);
+	}
+
+	public BigInteger getBigIntegerValue() {
+		throw new RuntimeDroolsException( "Conversion to BigInteger not supported for type double" );
+	}
+
 }

Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/base/field/LongFieldImpl.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/base/field/LongFieldImpl.java	2008-03-13 01:23:11 UTC (rev 18909)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/base/field/LongFieldImpl.java	2008-03-13 01:44:55 UTC (rev 18910)
@@ -1,5 +1,8 @@
 package org.drools.base.field;
 
+import java.math.BigDecimal;
+import java.math.BigInteger;
+
 import org.drools.RuntimeDroolsException;
 import org.drools.spi.FieldValue;
 
@@ -69,7 +72,7 @@
     public int hashCode() {
         return (int) this.value;
     }
-    
+
     public boolean isNull() {
         return false;
     }
@@ -98,4 +101,12 @@
         return false;
     }
 
+	public BigDecimal getBigDecimalValue() {
+		return new BigDecimal(this.value);
+	}
+
+	public BigInteger getBigIntegerValue() {
+		return BigInteger.valueOf(this.value);
+	}
+
 }

Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/base/field/ObjectFieldImpl.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/base/field/ObjectFieldImpl.java	2008-03-13 01:23:11 UTC (rev 18909)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/base/field/ObjectFieldImpl.java	2008-03-13 01:44:55 UTC (rev 18910)
@@ -2,13 +2,13 @@
 
 /*
  * Copyright 2005 JBoss Inc
- * 
+ *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,6 +16,8 @@
  * limitations under the License.
  */
 
+import java.math.BigDecimal;
+import java.math.BigInteger;
 import java.util.Collection;
 
 import org.drools.RuntimeDroolsException;
@@ -27,7 +29,7 @@
 
     private static final long serialVersionUID = 400L;
     private final Object      value;
-    
+
     private final boolean     isCollection;
     private final boolean     isNumber;
     private final boolean     isBoolean;
@@ -65,7 +67,7 @@
             return ((Number) this.value).byteValue();
         } else if( isString ) {
             return Byte.valueOf( (String) this.value ).byteValue();
-        } 
+        }
         throw new RuntimeDroolsException( "Conversion to byte not supported for type: " + this.value.getClass() );
     }
 
@@ -142,7 +144,7 @@
             return 0;
         }
     }
-    
+
     public boolean isNull() {
         return value == null;
     }
@@ -162,12 +164,34 @@
     public boolean isObjectField() {
         return true;
     }
-    
+
     public boolean isCollectionField() {
         return this.isCollection;
     }
-    
+
     public boolean isStringField() {
         return this.isString;
     }
+
+	public BigDecimal getBigDecimalValue() {
+		if (this.value instanceof BigDecimal) return (BigDecimal) this.value;
+		if (this.isNumber) {
+			return new BigDecimal(((Number) value).doubleValue());
+		} else if (this.isString) {
+			return new BigDecimal((String) value);
+		}
+		if (this.value == null) return null;
+        throw new RuntimeDroolsException( "Conversion to BigDecimal not supported for type: " + this.value.getClass() );
+	}
+
+	public BigInteger getBigIntegerValue() {
+		if (this.value instanceof BigInteger) return (BigInteger) this.value;
+		if (this.isNumber) {
+			return BigInteger.valueOf(((Number) value).longValue());
+		} else if (this.isString) {
+			return new BigInteger((String) value);
+		}
+		if (this.value == null) return null;
+        throw new RuntimeDroolsException( "Conversion to BigInteger not supported for type: " + this.value.getClass() );
+	}
 }
\ No newline at end of file

Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/spi/FieldValue.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/spi/FieldValue.java	2008-03-13 01:23:11 UTC (rev 18909)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/spi/FieldValue.java	2008-03-13 01:44:55 UTC (rev 18910)
@@ -2,13 +2,13 @@
 
 /*
  * Copyright 2005 JBoss Inc
- * 
+ *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -17,6 +17,8 @@
  */
 
 import java.io.Serializable;
+import java.math.BigDecimal;
+import java.math.BigInteger;
 
 public interface FieldValue
     extends
@@ -26,6 +28,10 @@
 
     public char getCharValue();
 
+    public BigDecimal getBigDecimalValue();
+
+    public BigInteger getBigIntegerValue();
+
     public int getIntValue();
 
     public byte getByteValue();
@@ -39,7 +45,7 @@
     public double getDoubleValue();
 
     public boolean getBooleanValue();
-    
+
     public boolean isNull();
 
     public boolean isBooleanField();
@@ -55,7 +61,7 @@
      * @return
      */
     public boolean isCollectionField();
-    
+
     public boolean isStringField();
 
 }
\ No newline at end of file

Deleted: labs/jbossrules/trunk/drools-jbrms/build-readme.html
===================================================================
--- labs/jbossrules/trunk/drools-jbrms/build-readme.html	2008-03-13 01:23:11 UTC (rev 18909)
+++ labs/jbossrules/trunk/drools-jbrms/build-readme.html	2008-03-13 01:44:55 UTC (rev 18910)
@@ -1,3 +0,0 @@
-<html><head>
-      <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-   <title>Introduction</title><link rel="stylesheet" href="html.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.70.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="d0e1"></a>Introduction</h2></div></div><hr></div><p>This section covers the innards of the BRMS - it is not neccesary to use this if you are integrating or an end user of the BRMS application. However, JBoss Rules is open source, so build instructions form part of the manual.</p><p>You may want to build from source if you want to re-use components, or embed the application in your own.</p><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="d0e8"></a>Design</h3></div></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="d0e11"></a>Building!
  from source</h3></div></div></div><p>This section will go over the steps you will need to take to build various components. Mostly this is automated, but the manual process is described for thoroughness.</p><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="d0e16"></a>Modules</h4></div></div></div><p>There are 2 modules: drools-repository (back end) and drools-jbrms (front end and rules integration). The drools-jbrms module depends on the drools-repository module, as well as other components.</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="d0e21"></a>Working with Maven 2</h4></div></div></div><p>Maven 2 is used as the underlying build system. To get started, you will need to check out the WHOLE of the source tree for JBoss Rules. This includes the other modules, and the top level lib and repository directories (which are needed by the build). As the BRMS build is part of the main dr!
 ools build.</p><p>Initially, you should go into the root of the jboss-
rules checked out source tree, and run mvn install to install all the components for the inter project depedencies. If the build is broken (no ! say it isn't so !) you can use the flag -Dmaven.test.skip=true to prevent failing unit tests from preventing the build.</p><p>As the BRMS depends on drools-repository (which is the back end version storage subsystem), you then go into the drools-repository directory, and run "mvn install" to make it available. Finally, you can go into the drools-jbrms directory and run "mvn test" to check it all works, or "mvn package" to generate the web application (as well as run the tests). You should now be good to go !</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="d0e30"></a>Working with GWT</h4></div></div></div><p>The GUI widgets for the web front end are developed with GWT (google web toolkit). If you need to make changes to or build the GUI, you will need to download GWT seperately. Onc!
 e GWT is downloaded, you can modify the build.properties file in the drools-jbrms directory to point to where you installed GWT. Once you have this, you can use the ant tasks to build the GWT components, as well as launch GWT in debug/hosted mode should you desire. If you run the build, it will update the webapp directory in the project with the new "compiled" artifacts (GWT does not use JSP, only html and javascript at runtime).</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="d0e35"></a>Debugging, Editing and running with Eclipse</h4></div></div></div><p>Each module has a ready to go and up to date eclipse project configuration, so you can just import them into your eclipse workspace. These projects are generated by maven (mvn eclipse:eclipse to refresh them). They have been manually modified to have project dependencies (means you can step through code when debugging).</p><p>Some environment variables are required in ecl!
 ipse (Window-&gt;Preferences-&gt;Java-&gt;Build path-&gt;Classpath var
iables): the M2_REPO, as normal, to point to where maven downloads shared dependencies. GWT_HOME should point to where you installed GWT. GWT_DEV must point to the platform specific "dev" jar that ships with the version of GWT you have.</p><p>How you launch from eclipse: you can launch unit test, as normal (in which case you only need M2_REPO setup - you don't even need to download GWT seperately) - OR, you can launch it in "hosted mode" using the GWT browser, which is great for debugging (from GUI to back end, you can step through code, and make changes on the fly and simply hit refresh). There is a JBRMS.launch file in in the drools-jbrms directory. This should allow Eclipse to launch the JBRMS in debug mode - open the Run dialog (Run-&gt;Run), and then choose "JBRMS" from the list. Launching this will open a new window, with the BRMS in debug mode, ready to go.</p><p>Downloading and debugging the BRMS with GWT is optional, and if you are only working on non GUI issues, yo!
 u can skip this step.</p></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="d0e46"></a>Re-usable components</h3></div></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="d0e49"></a>Versioning and Storage</h3></div></div></div></div></div></body></html>
\ No newline at end of file

Modified: labs/jbossrules/trunk/drools-jbrms/build.xml
===================================================================
--- labs/jbossrules/trunk/drools-jbrms/build.xml	2008-03-13 01:23:11 UTC (rev 18909)
+++ labs/jbossrules/trunk/drools-jbrms/build.xml	2008-03-13 01:44:55 UTC (rev 18910)
@@ -17,7 +17,7 @@
 		<gwt:compile outDir="src/main/webapp" 
 			gwtHome="${gwt.home}"
 			classBase="org.drools.brms.JBRMS" 
-			sourceclasspath="src/main/java; ../drools-compiler/src/main/java; ../m2_repo/com/gwtext/gwtext/0.9.3/gwtext-0.9.3.jar" 
+			sourceclasspath="src/main/java; ../drools-compiler/src/main/java; ../m2_repo/com/gwtext/gwtext/2.0.1/gwtext-2.0.1.jar" 
 		/>
 	</target>
 

Modified: labs/jbossrules/trunk/drools-jbrms/src/main/java/org/drools/brms/client/decisiontable/GuidedDecisionTableWidget.java
===================================================================
--- labs/jbossrules/trunk/drools-jbrms/src/main/java/org/drools/brms/client/decisiontable/GuidedDecisionTableWidget.java	2008-03-13 01:23:11 UTC (rev 18909)
+++ labs/jbossrules/trunk/drools-jbrms/src/main/java/org/drools/brms/client/decisiontable/GuidedDecisionTableWidget.java	2008-03-13 01:44:55 UTC (rev 18910)
@@ -120,17 +120,17 @@
 		        list.addItem( "Choose..." );
 
 
-		        if (!hasAttribute("salience", dt.attributeCols)) list.addItem( "salience" );
-		        list.addItem( "enabled" );
-		        list.addItem( "date-effective" );
-		        list.addItem( "date-expires" );
-		        list.addItem( "no-loop" );
-		        list.addItem( "agenda-group" );
-		        list.addItem( "activation-group" );
-		        list.addItem( "duration" );
-		        list.addItem( "auto-focus" );
-		        list.addItem( "lock-on-active" );
-		        list.addItem( "ruleflow-group" );
+		        addItem( "salience",list);
+		        addItem( "enabled", list );
+		        addItem( "date-effective", list );
+		        addItem( "date-expires", list );
+		        addItem( "no-loop", list );
+		        addItem( "agenda-group", list );
+		        addItem( "activation-group", list );
+		        addItem( "duration", list );
+		        addItem( "auto-focus", list );
+		        addItem( "lock-on-active", list );
+		        addItem( "ruleflow-group", list );
 
 		        pop.addAttribute("New attribute:", list);
 
@@ -156,6 +156,10 @@
 		        pop.show();
 			}
 
+			private void addItem(String at, final ListBox list) {
+				if (!hasAttribute(at, dt.attributeCols)) list.addItem( at );
+			}
+
 			private boolean hasAttribute(String at, List attributeCols) {
 				for (Iterator iterator = attributeCols.iterator(); iterator
 						.hasNext();) {




More information about the jboss-svn-commits mailing list