Incorporate a new rule file

To incorporate a new rule file, you must define a new rule set that must reference the same DSL file that is referenced within the rule file. This rule set must be saved to a custom XML file under WEB-INF/config/custom/xml. Furthermore, you must overwrite the existing rule context to which the new rule set is to belong, and also save it to a custom XML file under the path mentioned above. In the following example, the rules of the USERGROUP form are extended by two new rules.

Location

DRL file in the rules folder

XML file in the xml folder

Procedure

  1. Copy the DRL file of the required form.
  2. Keep the header up to the import statements and delete the rest.
  3. Add new rules according to your requirements.
  4. Incorporate the new DRL file into a new rule set and save it to a custom.xml file.
  5. Overwrite the rule context of the corresponding form and incorporate the new rule set in addition to the default set.

Documents

Corresponding DRL file in the default configuration

Corresponding DSL file in the default configuration

rulesetReg.xml in the default

Java doc of the CollectiveHelper class and its derived classes for an overview of possible conditions and consequences.

Example

ModifyRules_AddDRL\WEB-INF\config\custom\rules\usergroup.drl: Add custom rule set

ModifyRules_AddDRL\WEB-INF\config\custom\xml\custom_ruleContext.xml: Overwrite the ruleContext and add the custom ruleSet

ModifyRules_AddDRL\WEB-INF\config\custom\xml\custom_ruleContext.xml: Add custom ruleSet

ModifyRules_AddDRL\WEB-INF\config\custom\xml\custom_usergroupform: Enable rule execution on change of form element 'name'