Creating a new rule model class

You can extend the rule model by creating a custom rule model class.

About this task

A custom rule model class must be the subclass of an existing rule model class.

Procedure

To create a custom rule model class:

  1. Create or open an extension model file.
  2. In the Rule Model Extension Editor, right-click the extension model entry and then click New Child  > Class.

    The tree displays a new Class item.

  3. Select the Class item and, in the Properties view, set the Name property to the name of the new rule model class, and the Extends property to the name of the existing rule model class you want to subclass.

Results

You have now created a custom rule model class. You can add properties and annotations to this new rule model class.

In XML, you can create a custom rule model class as follows:


<class name="MyRule" extends="BRLRule">
   <property name="myProperty1" type="String"/>
   <property name="myProperty2" type="Integer"/>
</class>