Enables you to specify 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 may specify that only the definitions belonging to a particular referencing definition are listed.
Example 1
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 }
KEYED BY {"Package", "Class Name":"Class", Name} LENGTH
4096 DISPLAY {FORMAT COMPONENT_SCRIPT
_FmtNewUMLObjInstAttr LEGEND "$$FORCE$$"} }
..}
In the example above, 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. (As an aside, also in the example above, the attribute itself is specified to be keyed by its package, class name, and its own attribute name through the statement KEYED BY {"Package", "Class Name":"Class", Name.)
In the example above, 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". Note that this is a definition for an OMT Sequence diagram; the UML Sequence diagram has additional keying (by package) than this example.