All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.drools.verifier.reports.RangeCheckReports.drl Maven / Gradle / Ivy

There is a newer version: 9.44.0.Final
Show newest version
#created on: 7.6.2007
package org.drools.verifier.rangeChecks.reports;

#list any import classes here.
import org.drools.verifier.components.Field;
import org.drools.verifier.report.components.VerifierRangeCheckMessage;
import org.drools.verifier.dao.VerifierResult;
import org.drools.verifier.report.components.MissingRange;
import org.drools.verifier.report.components.Severity;
import org.drools.verifier.report.components.MessageType;

import java.util.ArrayList;

#declare any global variables here
global VerifierResult result


#
# Dependencies:
#
#	Needs at least one of the following packages or rules to fire:
# 		package org.drools.verifier.rangeChecks.patterns;
#			rule "Range check for number patterns"
#			rule "Range check for number patterns, !="
#		package org.drools.verifier.rangeChecks.integers
#			rule "Range check for integers, if smaller than or equal is missing"
#			rule "Range check for integers, if greater than or equal is missing"
#			rule "Range check for integers, equal and greater than"
#			rule "Range check for integers, equal and smaller than"
#		package org.drools.verifier.rangeChecks.doubles
#			rule "Range check for doubles, if smaller than or equal is missing"
#			rule "Range check for doubles, if greater than or equal is missing"
#			rule "Range check for doubles, equal and greater than"
#			rule "Range check for doubles, equal and smaller than"
#		package org.drools.verifier.rangeChecks.dates
#			rule "Range check for dates, if smaller than or equal is missing"
#			rule "Range check for dates, if greater than or equal is missing"
#			rule "Range check for dates, equal and greater than"
#			rule "Range check for dates, equal and smaller than"
#
#	The following rules are used to clean up the data that this rule uses,
#	but they are not always necessary:
#		package org.drools.verifier.rangeChecks.cleanUp
#			rule "Merge gaps"
#			rule "Remove useless integer gaps lesser or lesser and equal"
#			rule "Remove useless integer gaps greater or greater and equal"
#			rule "Remove useless double gaps lesser or lesser and equal"
#			rule "Remove useless double gaps greater or greater and equal"
#			rule "Remove useless date gaps lesser or lesser and equal"
#			rule "Remove useless date gaps greater or greater and equal"
#
rule "Collect gaps"
	salience -100
	when
		$f :Field()
		$list :ArrayList( size > 0)
			from collect(
				MissingRange( field == $f )
			)
	then
		result.add( new VerifierRangeCheckMessage(
								Severity.WARNING, $f,
								$f + " has one or more gaps.", $list ) );
end




© 2015 - 2025 Weber Informatics LLC | Privacy Policy