Creating a rule model class

You define a rule model class so that you can use a new business rule language.

About this task

Deprecated feature:

Deprecation icon Support for custom business rule languages is deprecated in V8.8.1. This feature will be removed in a future release of the product. See Deprecated features for migration details.

To be able to use a dedicated business rule language, you must define a new class of business rule in the rule model.

Procedure

To create a rule model class for a new business rule language:

  1. In Rule Designer, create or open an extension model file.
  2. In the Rule Model Extension Editor, right-click the extension model entry, and 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 class BRLRule.
  4. In the Rule Model Extension Editor, right-click the new class and then click New Child  > Annotation.

    The tree displays a new Annotation item.

  5. Select the Annotation item and, in the Properties view, set the Id property to language, and the Value property to the name of the business rule language.

Results

You now have a custom rule model class for the new business rule language. You can add properties to this class so that every rule created with the class has these properties.

In XML, you create a rule model class for a new language as follows:

<class name="MyRuleType" extends="BRLRule">
   <annotation id="language" value="myLanguage"/>
</class>