ILOG JRules User Guide > Customizing JRules > Tasks > Defining Common Model Extensions for Rule Studio and Rule Team Server > Defining Rule Model Extensions > Creating a Hierarchical Property

To define a hierarchical property, you need to create it in an extension model file, and specify the values of the hierarchy in an extension data file.

Warning
Do not use a reserved SQL keyword as the name of a property.

To create a hierarchical property:

  1. Create or open an extension model file.
  2. In the Rule Model Extension Editor, right-click the extension model entry, and click New Child > Hierarchy.
  3. A new Hierarchy item appears in the tree.
  4. Select the Hierarchy item, and, in the Properties view, set the Name property to the name of the new hierarchy.
  5. Right-click the rule model element to which you want to attach the hierarchical property, and click New Child > Property.
  6. A new Property item appears in the tree.
  7. Select the Property item, and, in the Properties view, set the Name property to the name of the item as you want it to appear in the Properties view, and the Type property to the name of the hierarchy.
  8. Save the extension model file, and create or open an extension data file.
  9. In the Rule Model Extension Editor, right-click the extension data entry, and click New Child > Hierarchy Data.
  10. A new Hierarchy Data item appears in the tree.
  11. Select the Hierarchy Data item, and, in the Properties view, set the Name property to the name you gave to the hierarchy in the extension model file.
  12. Right-click the Hierarchy Data item, and click New Child > Node.
  13. Set the Name property of the Node item. You can add child nodes to this node to create the hierarchy data.
  14. Save the extension data file.
  15. You have now created a hierarchical property and attached it to a rule model element.

In XML, you create a hierarchy as follows:

<class extends="ActionRule" name="MyRule">
  <property name="location" type="Location"/>
</class>
<hierarchy name="Location"/>
<hierarchy-data>
  <node name="Location">
    <node name="Europe">
      <node name="France"/>
    </node>
    <node name="USA">
      <node name="Dakota"/>
    </node>
  </node>
</hierarchy-data>

Related Concepts

Rule Model

Related Tasks

Defining Rule Model Extensions
Creating a New Rule Model Class
Hiding a Rule Model Class
Creating an Enumeration Property
Creating a Struct Property
Associating a Custom Editor to a Property

Related Reference

Rule Model Extension Editor

Related Samples and Tutorials

Rule Studio Business Rule Management Extensions
Rule Team Server Business Rule Management Extensions