org.drools.verifier.equivalence.Rules.drl Maven / Gradle / Ivy
#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