Editing Feature Rules

Feature rules execute procedures, such as automatic data correction or adding functionality, whenever changes are made to the database. There are client-side and server-side feature rules.

Feature rules are methods and triggers that process data accordingly to predefined algorithms. For example, rules perform complex consistency and dependency checks at certain events, such as before inserting or after modifying a feature. You can edit some aspects of the default rules provided with industry models.

Feature rules are provided with AutoCAD Map 3D. However, if you have some experience with PL/SQL triggers, you can define your own server-side feature rules via Oracle triggers and the API. Please refer to the respective manuals.

Note: SQL Server-based enterprise industry models support server-side and client-side feature rules. There are some predefined server side feature rules for SQL Server (for example, geometry validation). Experienced users can define server-side feature rules on SQL Server using the Infrastructure Administrator. However, for SQL Server the programming language is not PL/SQL, but Transact SQL (TSQL), the Microsoft counterpart. The syntax is different, and the Infrastructure Administrator will not validate the syntax.

Users with a .NET developer kit (and some .NET knowledge and experience) can create their own client-side feature rules.

The feature rule configuration is stored in the industry model in the system tables TB_RULE_*. Feature rules are stored in the system table TB_RULE_DEF in the industry model.

You can assign an existing rule to a feature class, and you can edit the properties of an existing rule.

Note: If the product language of AutoCAD Map 3D and the Oracle data base don't match, server-side rules will not work when feature class names are copied into trigger text as a parameter. Instead, the rule will be applied to a feature class.
Feature Rule Properties Description
Feature Class Name of the feature class

Server Side (PL/SQL)

Client Side (.NET) Feature rules can be server-side or client-side.

Click the respective tab. You can define only server-side feature rules.
Applied Rule Bases Lists feature rules that are currently assigned to the feature class. The assigned feature rules are recorded in the system table TB_RULE_BASE.

The TB_RULE_FCLASSTYPE table defines which feature rule is available for which feature class type. Example: Calculating the length is valid for LineString feature classes but not for point feature classes.

Priority Defines the execution order of the feature rules. A feature rule with a lower priority value is executed before a rule with a higher value.

Example: Validate the geometry of a feature before calculating the area.

Use the Up and Down buttons to change the order and modify the priority.

Rule Base Definitions Lists all feature rules (TB_RULE_DEF) and rule groups (TB_RULE_GROUP) that are available for the current feature class.

If you select a group, all included rules are added to the Applied Rule Bases list.

Note: Only feature rules that are not part of a group are available individually.
New Group A group can contain several feature rules that define other rules, such as one Before and one After rule.

Server-side rules must adhere to the Oracle trigger limitations. In particular, row triggers cannot query or modify tables in jobs, except for the changed row. Because of this, most server-side rules are implemented as a group of rules. A group of feature rules consists of a before-action rule on the row that inserts the ROWID of modified features into a temporary table, and an after-action statement rule doing the actual work.

You can add feature rules only if they do not yet belong to another rule group. Also, you cannot add the system feature rules to a new customer rule group.

Event Event to which a feature rule reacts.
BI Before insert
BU Before update
BD Before delete
AI After insert
AU After update
AD After delete

Steps in this workflow: