[jboss-svn-commits] JBL Code SVN: r18560 - in labs/jbossrules/branches/4.0.x/drools-compiler/src: test/resources/org/drools/integrationtests and 1 other directory.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Fri Feb 22 09:01:58 EST 2008
Author: tirelli
Date: 2008-02-22 09:01:57 -0500 (Fri, 22 Feb 2008)
New Revision: 18560
Modified:
labs/jbossrules/branches/4.0.x/drools-compiler/src/main/java/org/drools/rule/builder/PatternBuilder.java
labs/jbossrules/branches/4.0.x/drools-compiler/src/test/resources/org/drools/integrationtests/test_DeepNestedConstraints.drl
Log:
JBRULES-1479: fixing problem with predicate constraints
Modified: labs/jbossrules/branches/4.0.x/drools-compiler/src/main/java/org/drools/rule/builder/PatternBuilder.java
===================================================================
--- labs/jbossrules/branches/4.0.x/drools-compiler/src/main/java/org/drools/rule/builder/PatternBuilder.java 2008-02-22 13:14:50 UTC (rev 18559)
+++ labs/jbossrules/branches/4.0.x/drools-compiler/src/main/java/org/drools/rule/builder/PatternBuilder.java 2008-02-22 14:01:57 UTC (rev 18560)
@@ -518,6 +518,9 @@
if ( container == null ) {
pattern.addConstraint( predicateConstraint );
} else {
+ if( predicateConstraint.getType().equals( Constraint.ConstraintType.UNKNOWN ) ) {
+ this.setConstraintType( pattern, (MutableTypeConstraint) predicateConstraint );
+ }
container.addConstraint( predicateConstraint );
}
Modified: labs/jbossrules/branches/4.0.x/drools-compiler/src/test/resources/org/drools/integrationtests/test_DeepNestedConstraints.drl
===================================================================
--- labs/jbossrules/branches/4.0.x/drools-compiler/src/test/resources/org/drools/integrationtests/test_DeepNestedConstraints.drl 2008-02-22 13:14:50 UTC (rev 18559)
+++ labs/jbossrules/branches/4.0.x/drools-compiler/src/test/resources/org/drools/integrationtests/test_DeepNestedConstraints.drl 2008-02-22 14:01:57 UTC (rev 18560)
@@ -5,7 +5,7 @@
rule "deep nested constraints"
when
Person( $likes : likes )
- Cheese( ( ( type == "stilton" || type == $likes ) && ( price < 10 || price > 50 ) ) || type == "brie" )
+ Cheese( ( ( type == "stilton" || type == $likes ) && ( price < 10 || price > 50 ) ) || eval( type.equals("brie") ) )
then
results.add( "OK" );
end
More information about the jboss-svn-commits
mailing list