Customizing the metamodel > Keywords for USRPROPS > OF DEFINITION REFERENCED IN
  
OF DEFINITION REFERENCED IN
OF DEFINITION REFERENCED IN specifies a restricted list of definitions that you can choose from when you click Choices for a property. It is used to add further refinement to an EDIT LISTOF or EDIT ONEOF statement. You can specify that only the definitions belonging to a particular referencing definition are listed.
Syntax
This can be combined with the WHERE clause, but this syntax must precede it:
OF DEFINITION REFERENCED IN "property_name" [WHERE ...]
Example 1
In the following example, when you click Choices in an object’s Attribute grid, only the attributes of the object’s containing class are provided. The “Class” property that OF DEFINITION REFERENCED IN is referencing must also be specified in the object’s definition, as is shown above.
The attribute itself is specified to be keyed by its package, class name, and its own attribute name through the KEYED BY {"Package", "Class Name":"Class", Name) statement.
DEFINITION "Object"
{
PROPERTY "Package"
{ KEY EDIT OneOf "Package" RELATE BY "is keyed by" READONLY}
PROPERTY "Class"
{ KEY EDIT OneOf "Class" KEYED BY { "Package", Name }
RELATE BY "is keyed by" READONLY }
PROPERTY "Attributes"
{ ZOOMABLE EDIT LISTOF "Class Attribute"
OF DEFINITION REFERENCED IN "Class"
KEYED BY {"Package", "Class Name":"Class", Name}
LENGTH 4096
DISPLAY
{FORMAT COMPONENT_SCRIPT _FmtNewUMLObjInstAttr LEGEND "$$FORCE$$"}
}
...
}
Example 2
In the following example, the definition of a message line is refined so that only the methods of the class of the object that the message line is drawn to are listed. These are methods of the “To Class”. This is possible since the object symbol (object lifeline) that the message line is drawn to contains properties for its referencing class, and the message line contains that property, “To Class”. This is a definition for an OMT Sequence diagram; the UML Sequence diagram has additional keying (by package) than this example.
DEFINITION "Message"
{
PROPERTY "To Class"
{ KEY EDIT OneOf "Class" }
...
PROPERTY "Operation"
{ EDIT ParmOneOf "Method"
OF DEFINITION REFERENCED IN "To Class"
KEYED BY { "Class Name" : "To Class", Name, "Formal Parameters"}
LENGTH 1000}
...
}
For an example of a UML message line definition, see OF DEFINITION AND SUPERS REFERENCED IN.
See also
Keywords for USRPROPS