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 may 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} } }
Once 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 will you be able to open any “Car Version” definitions from the explorer. If you try to, System Architect will give you a message that says you can only open the definition 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 we do not want to keep track of the “Car Brand” and the “Car Model” as well as the “Car Version” for a Rental Car. We want one property, Car Type, that we can enter a car type into and have it worry about its make and model. So if we specify a 'Car Type' for a Rental Car, we do not have a property within the Rental Car definition within which to keep the Car's Brand or Model. We 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 } } }
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 if you click Choices, or type the values with appropriate periods.