A redirected rule is a circumstance rule that is configured to reference another circumstance rule for the same base rule. Redirection is available for Decision Tables ( Rule-Declare-DecisionTable).
At run time, if rule resolution initially selects a redirected rule, the system accesses the target of the redirection, and that second rule runs. (If the target is not found, the base rule runs.) The system ignores all fields on the redirected rule form, except for the redirection details and the rule name.
Redirection can simplify maintenance of a set of circumstance rules. For example, an application might include a decision table named SalesTax that computes state sales taxes for a state and is circumstanced by state code, such as VA for Virginia.
Your application needs one base rule and 50 circumstance-qualified rules, one for each state code. However, if the tax structure of several states (such as Alaska, Delaware, Florida, Montana, and New Hampshire) is identical, you can:
- Create a circumstance rule for Alaska (with AK as the circumstance value) that defines the Alaska state sales tax.
- Create circumstance rules for Delaware, Florida, Montana, and New Hampshire which are marked to redirect to the AK rule.
Redirection does not reduce the number of circumstance rules you need to create, but it can reduce your maintenance effort when several of them operate alike (that is, are functionally equivalent).
- Redirection is possible only for single value circumstancing and not template circumstancing.
- The target of a redirected rule can be another redirected rule.
- You cannot redirect a rule to itself. You should avoid creating a circular set of redirections (A to B and B to A), as doing so causes an exception at run time.