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

org.drools.verifier.equivalence.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.equivalency.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 where consequences are not redundant, 
# does not include actual pattern and restriction checks.
#
# Dependencies: None
#
rule "Find equivalent Rules"
	when
		# Check that VerifierRule $left and $right have redundant fields.
		$left :VerifierRule()
		$right :VerifierRule( 
			id != $left.id, 
			ruleAgendaGroup == $left.ruleAgendaGroup
		)
		
		not 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.WEAK, $left, $right ) );
end





© 2015 - 2025 Weber Informatics LLC | Privacy Policy