Skip to content
Browse files

[PMML] Prevent duplicate rules

  • Loading branch information...
1 parent a235481 commit ad8948e3dca7b391189d0ee35d374721d2ee6a2f @sotty sotty committed Oct 10, 2013
View
9 ...former/drools-informer-pmml/src/main/resources/org/drools/pmml/pmml_4_1/pmml_informer.drl
@@ -169,11 +169,14 @@ end
rule "Invalid_meta"
dialect "mvel"
when
- exists EnableSurvey()
+ EnableSurvey( $model : modelName )
then
//System.err.println("Found Mined Field " + $fld.name );
- applyTemplate( "modelInvalidAnswer.drlt", utils, registry, java.util.Collections.emptyMap(), theory );
- applyTemplate( "modelRevalidate.drlt", utils, registry, java.util.Collections.emptyMap(), theory );
+ HashMap map = new HashMap( 3 );
+ map.put( "name", $model );
+
+ applyTemplate( "modelInvalidAnswer.drlt", utils, registry, map, theory );
+ applyTemplate( "modelRevalidate.drlt", utils, registry, map, theory );
end
View
2 ...ml/src/main/resources/org/drools/pmml/pmml_4_1/templates/informer/modelInvalidAnswer.drlt
@@ -26,7 +26,7 @@
@declare{'modelInvalidAnswerRule'}
-rule "Invalid_Answer_for_Question"
+rule "Invalid_Answer_for_Question_@{name}"
no-loop
when
$bean : DataField( valid == false, $ct : context )
View
4 ...-pmml/src/main/resources/org/drools/pmml/pmml_4_1/templates/informer/modelRevalidate.drlt
@@ -26,7 +26,7 @@
@declare{'modelRevalidateRule'}
-rule "Model_Revalidate"
+rule "Model_Revalidate_@{name}"
no-loop
salience 50
when
@@ -51,7 +51,7 @@ then
end
-rule "Model_Invalidate"
+rule "Model_Invalidate_@{name}"
no-loop
salience 35
when

0 comments on commit ad8948e

Please sign in to comment.
Something went wrong with that request. Please try again.