Adding properties to rule model elements

You can add properties to rule model elements by using the Rule Model Extension Editor in Rule Designer or in XML.

About this task

You can add properties to rule model elements in extension model files. You add properties to existing rule model elements and custom rule model classes the same way.

You can set annotations on the extensions to define additional information such as SQL column name and length, or related to reserved SQL keywords. See Rule model annotations.

Procedure

To add a property to a rule model element in the editor:

  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  > Add Property.

    The tree displays a new Add Property item.

  3. Select the Add Property item and, in the Properties view, set the Class Name property to the name of the rule model element to which you want to add the property.
  4. Right-click the Add Property item and then click New Child  > Property.

    The tree displays a new Property item, as a child of Add Property.

  5. In the Properties view, edit the name, type, and properties of the new property.

Results

You have now added a property to a rule model element.

In XML, you add a property to a rule model element as follows:


<add-property className="ActionRule">
    <property name="myProperty" type="String"/>
</add-property>