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

org.drools.verifier.redundancy.Rules.drl Maven / Gradle / Ivy

There is a newer version: 9.44.0.Final
Show newest version
#created on: 7.9.2007
package org.drools.verifier.redundancy.rules

import org.drools.verifier.components.VerifierRule;
import org.drools.verifier.report.components.Redundancy;
import org.drools.verifier.report.components.RedundancyType;

#
# Only checks for redundant rule specifications,
# does not include actual pattern and restriction checks.
#
# Dependencies:
#
#		package org.drools.verifier.redundancy.consequences
#			rule "Find redundant TextConsequences"
#
rule "Find redundant Rules, strong redundancy"
	when
		# Check that VerifierRule $left and $right have redundant fields.
		$left :VerifierRule()
		$right :VerifierRule(
			id != $left.id,
			ruleAgendaGroup == $left.ruleAgendaGroup
		)

		exists Redundancy(
			left == $left.consequence,
			right == $right.consequence
		)

		# Check that there is not already a pair with these values.
		not Redundancy(
			left == $left,
			right == $right
		)
	then
		insert( new Redundancy( RedundancyType.STRONG, $left, $right ) );
end





© 2015 - 2025 Weber Informatics LLC | Privacy Policy