Specifying Constraints Through Business Rules

In addition to the constraints specified on the Standard Checks tab, you can specify business rules of type Validation or Constraint to control your data. Both types of rule contain SQL code to validate your data, and you can attach them to tables and table columns in your PDM, entities and entity attributes in your CDM or LDM, and domains.

You can use the following PowerDesigner variables when writing your rule expression:

Variable

Value

%COLUMN%

Code of the column to which the business rule applies

%DOMAIN%

Code of the domain to which the business rule applies

%TABLE%

Code of the table to which the business rule applies

%MINMAX%

Minimum and maximum values for the column or domain

%LISTVAL%

List values for the column or domain

%RULES%

Server validation rules for the column or domain

To attach a business rule (see Business Rules (CDM/LDM/PDM)) to a table, column, entity, attribute, or domain, open the object's property sheet, select the Rules tab, and click the Add Objects tool.

At generation time, business rules of type validation are concateneated together into a single constraint, while rules of type Constraint will be generated as separate constraints if your DBMS supports them.