You define a hierarchical property in an extension model
file and attach it to a rule model element.
About this task
To define a hierarchical property, create it in an extension
model file and then specify the values of the hierarchy in an extension
data file.
Attention: Do not use a reserved SQL
keyword as the name of a property.
Procedure
To create a hierarchical property:
- Create or open an extension model file.
- In the Rule Model Extension Editor, right-click the extension
model entry and then click .
The
tree displays a new Hierarchy item.
- Select the Hierarchy item and, in the Properties
view, set the Name property to the name of the
new hierarchy.
- Right-click the rule model element to which you want to
attach the hierarchical property and then click .
The tree displays a new Property item.
- Select the Property item and, in the Properties
view, set these properties:
- Save the extension model file and then create or open an
extension data file.
- In the Rule Model Extension Editor, right-click the extension
data entry and then click .
The
tree displays a new Hierarchy Data item.
- 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.
- Right-click the Hierarchy Data item and
then click .
- Set the Name property of the Node item.
You can add child nodes to this node to create the hierarchy data.
- Save the extension data file.
Note: A hierarchical
property cannot have multiple values (many=true), as it represents
a path. An example is the 'package' information: a rule cannot be
several packages.
Results
You have now created a hierarchical property and attached
it to a rule model element.
In XML, you create a hierarchy as
follows:
In the extension model file:
<class extends="ActionRule" name="MyRule">
<property name="location" type="Location"/>
</class>
<hierarchy name="Location"/>
In the extension data file:
<hierarchy-data>
<node name="Location">
<node name="Europe">
<node name="France"/>
</node>
<node name="USA">
<node name="Dakota"/>
</node>
</node>
</hierarchy-data>