Customizing the metamodel > Specifying key and keyed by properties > Examples of key and keyed by > Example of “complete” keyword
  
Example of “complete” keyword
It is arguable whether or not you want users to type in new definitions of Car Versions independently of the “Car Model”. For example, will someone enter in Si as a “Car Version”, and then specify that they are referring to a Honda Accord? Probably not. It might help your users if you force them to enter the “Car Brand” and “Car Model”, and then specify Car Versions in the ListOf property of Car Versions in the “Car Model” definition. What you are saying is that these “Car Versions” belong completely to the “Car Model”: to say you have an Si does not mean much by itself. Use the COMPLETE clause to do this.
DEFINITION "Car Model"
{
Property "Make"
{ KEY EDIT ONEOF "Car Brand" RELATE BY "is keyed by" REQUIRED}
REM "also contains a list of the versions"
Property "Versions"
{ EDIT COMPLETE LISTOF "Car Version" KEYED BY {"Brand":"Make", "Car Model":Name, Name} }
}
After you set the COMPLETE for a list, you will not see the “Car Version” definition amongst the definition types available when you create a new definition, nor you open any “Car Version” definitions from the explorer. If you try to, System Architect gives a message that says you can open the definition only from its containing definition, which in this case is “Car Model”.
Qualifiable example
Next, add a new definition to the encyclopedia to track Car Rentals. The new definition type Car Rental includes a property to track the Car Type of each rental.
The problem is you do not want to keep track of the “Car Brand” and the “Car Model” as well as the “Car Version” for a Rental Car. You want one property, Car Type, that you can enter a car type into and have it worry about its make and model. So if you specify a 'Car Type' for a Rental Car, you do not have a property in the Rental Car definition in which to keep the Car's Brand or Model. You use the QUALIFIABLE keyword.
RENAME DEFINITION "User 5" TO "Rental Car"
Definition "Rental Car"
{
Property "Car Type"
{ EDIT ONEOF "Car Version"
KEYED BY { "Brand" QUALIFIABLE, "Car Model" QUALIFIABLE, Name }
}
}
This graphic is described in the surrounding text.
The QUALIFIABLE phrase causes the ONEOF "Car Type" property to store the “Brand” and “Model” information. The information is stored in the value itself, separated by periods. You can either drag values from the Select and Drag dialog that opens when you click Choices, or type the values with appropriate periods.
See also
Examples of key and keyed by