Customizing the metamodel : Keywords for USRPROPS : TESTPROC, TESTPROPERTY, TESTSTRING
  
TESTPROC, TESTPROPERTY, TESTSTRING
The TESTPROC, TESTPROPERTY, and TESTSTRING command group provides a conditional capability for properties on a per-diagram basis. This command group provides similar functionality to #ifdefs, except that #ifdefs provide a conditional capability based on an encyclopedia-wide level. The TESTPROC command group works from a diagram property; a definition will contain a certain property set if a value is selected for a "test property" in the diagram’s properties.
The TESTPROC command group is especially used in logical data models, to specify data modeling property sets depending on the RDBMS chosen.
TESTPROC stands for Test Procedure. There are two values that can follow a TESTPROC keyword: TestPropertyValue and TestPropertyNotValue. If TESTPROC is followed by TestPropertyValue, it means "test the property and if it is the same as one of the values in the TESTSTRING specified, then apply the properties in this TESTPROC section to the definition in question". If TESTPROC is followed by TestPropertyNotValue, it means "test the property and if it is Not the same as one of the values in the TESTSTRING specified, then apply the properties in this TESTPROC section to the definition in question". There is case sensitivity when using TestPropertyValue and TestPropertyNotValue, the case must be exactly as specified. It will not work if you use all lower case or all uppercase.
TESTPROPERTY is the diagram property that will be queried.
TESTSTRING are the values that are queried. You can list one or more values in the string.
Controls and RefProps
A Property can only be used once in a definition (unless it is surrounded by #ifdef statements). If the user wants to use the same property more than once in a definition, they must use the Control and RefProp keywords. For this reason, the Control and RefProp keywords are often used in conjunction with TESTPROCs. For a Control to be used, there must be an initial reference to the Property that the Control references, at the top of the definition.
Note The TESTPROC keyword is associated with the last CHAPTER statement that is processed, and this affects the visibility of all the properties assigned to that chapter. This is the reason why, in the example given, an extra space has been added to the 2nd chapter name, so that will be recorded as a new chapter block.
Example
Definition "Index" { CHAPTER "Modeling Properties" { TESTPROC TestPropertyNotValue TESTPROPERTY "DBMS" TESTSTRING { "ORACLE 8" } } PROPERTY "Primary Key" {EDIT Boolean LENGTH 1 DEFAULT "F" READONLY } PROPERTY Unique {EDIT Boolean LENGTH 1 VALUESCRIPT ProcessIndexUnique DEFAULT "F" } PROPERTY Clustered {EDIT Boolean LENGTH 1 DEFAULT "F" } ...
CHAPTER "Modeling Properties " { TESTPROC TestPropertyValue TESTPROPERTY "DBMS" TESTSTRING { "ORACLE 8" } } Control "Primary Key" { REFPROP "Primary Key" } Control Unique { REFPROP "Unique" } Control Clustered {REFPROP "Clustered"} ... }