이 콘텐츠는 선택한 언어로 제공되지 않습니다.
Chapter 5. Overriding rules
You can override core rules distributed with MTA or even custom rules. For example, you can change the matching conditions, effort, or hint text for a rule. This is done by making a copy of the original rule, marking it as a rule override, and making the necessary adjustments.
You can disable a rule by creating a rule override with an empty <rule>
element.
5.1. Overriding a rule 링크 복사링크가 클립보드에 복사되었습니다!
You can override a core or custom rule.
Procedure
Copy the XML file that contains the rule you want to override to the custom rules directory.
Custom rules can be placed in
<MTA_HOME>/rules
,${user.home}/.mta/rules/
, or a directory specified by the--userRulesDirectory
command-line argument.Edit the XML file so that it contains only the
<rule>
elements for the rules that you want to override.NoteRules from the original ruleset that are not overridden by the new ruleset are executed as normal.
- Ensure that you keep the same rule and ruleset IDs. When you copy the original rule XML, this ensures that the IDs match.
-
Add the
<overrideRules>true</overrideRules>
element to the ruleset metadata. Update the rule definition.
You can change anything in the rule definition. The new rule overrides the original rule in its entirety.
The following rule override example changes the effort
of the weblogic-02000
rule in the weblogic
ruleset from 1
to 3
:
Rule override definition example
When you run MTA, this rule overrides the original rule with the same rule ID. You can verify that the new rule was used by viewing the contents of the Rule Provider Executions Overview.
5.2. Disabling a rule 링크 복사링크가 클립보드에 복사되었습니다!
To disable a rule, create a rule override definition with an empty <rule>
element according to the following example:
Rule override definition example to disable a rule
- 1
- The
<rule>
element is empty so that theweblogic-02000
rule in theweblogic
ruleset is disabled.