Rule Domains in Rule Engine
In Rule Engine, rule type is used to separate rules for different domains. To define a new set of rules for a different purpose, create a new rule domain by defining the source rule type and Drools rule type.
Defining Rule Domains
It is possible to set up multiple, separate sets of Rule Engine rules within one SAP Commerce installation. For example, you could use Promotion Engine to generate promotion rules, then use Rule Engine to create a set of product recommendation rules. Each of these sets of rules constitutes a separate "rule domain." Each different rule domain is separated by rule type.
Source Rule Type and Drools Rule Type
Each domain has a defined source rule type and Drools rule type. The source rule type and Drools rule type are mapped to each other in a 1:1 relationship.
-
Source Rule Type: When you create conditions and actions, you map them to a specific source rule type. The source rule type controls which conditions and actions you can use in a certain type of rule. In the Backoffice, when you create a new rule with a certain source rule type, the Rule Builder only displays the corresponding conditions and actions. This ensures that the correct conditions and actions are used to create that type of source rule.
-
Drools Rule Type: The Drools rule type is mapped to one or more modules. The Drools rule type controls which types of compiled rules are published to each module. Each module can publish only one type of rule.
Extensibility
If you want to extend Rule Engine and create a new rule domain, define both a new source rule type and a new Drools rule type. Then, map these to each other. To see how this is done, follow the Rule Engine trail. The trail creates a new source rule type (CustomSourceRule) and a new Drools rule type (CUSTOMDROOLSRULE). For more information, see Rule Engine Trail.Whenever you create a new rule type, you also need to create a module that you can publish the rules to. This step is also covered in the trail.