Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

JBRULES-3363: fixing bad cut&paste code

  • Loading branch information...
commit 8ada29d38ff15e7374e534a9e93a66cf465021db 1 parent de95743
@etirelli authored
View
10 drools-compiler/src/main/java/org/drools/rule/builder/PatternBuilder.java
@@ -292,10 +292,8 @@ public RuleConditionElement build( RuleBuildContext context,
}
}
- // Process all constraints
- processConstraintsAndBinds( context, patternDescr, pattern );
processAnnotations( context, patternDescr, pattern );
-
+
if ( patternDescr.getSource() != null ) {
// we have a pattern source, so build it
RuleConditionBuilder builder = (RuleConditionBuilder) context.getDialect().getBuilder( patternDescr.getSource().getClass() );
@@ -308,6 +306,9 @@ public RuleConditionElement build( RuleBuildContext context,
pattern.setSource( source );
}
+ // Process all constraints
+ processConstraintsAndBinds( context, patternDescr, pattern );
+
for ( BehaviorDescr behaviorDescr : patternDescr.getBehaviors() ) {
if ( pattern.getObjectType().isEvent() ) {
if ( Behavior.BehaviorType.TIME_WINDOW.matches( behaviorDescr.getSubType() ) ) {
@@ -1129,7 +1130,8 @@ private void buildEval( final RuleBuildContext context,
boolean isDynamic = requiredOperators.length > 0 ||
ClassObjectType.Activation_ObjectType.isAssignableFrom( pattern.getObjectType()) ||
- !context.getPackageBuilder().getTypeDeclaration(((ClassObjectType)pattern.getObjectType()).getClassType()).isTypesafe();
+ (!((ClassObjectType)pattern.getObjectType()).getClassType().isArray() &&
+ !context.getPackageBuilder().getTypeDeclaration(((ClassObjectType)pattern.getObjectType()).getClassType()).isTypesafe());
Constraint constraint = new MvelConstraint(context.getPkg().getName(), expr, mvelDeclarations, compilationUnit, isDynamic);
pattern.addConstraint( constraint );
View
2  drools-compiler/src/test/java/org/drools/integrationtests/AccumulateTest.java
@@ -969,7 +969,7 @@ public void testAccumulateMultipleFunctionsMVEL() throws Exception {
@Test
public void testAccumulateMultipleFunctionsConstraint() throws Exception {
- execTestAccumulateMultipleFunctions( "test_AccumulateMultipleFunctions.drl" );
+ execTestAccumulateMultipleFunctionsConstraint( "test_AccumulateMultipleFunctionsConstraint.drl" );
}
@Test
Please sign in to comment.
Something went wrong with that request. Please try again.