Properties

Properties set specific options for parts. You specify properties when you create a part. Properties are static; however, in certain circumstances, you can change a property dynamically.

Properties are different for each part and for each stereotype; when you create a part, check to see what properties are appropriate. Some parts have required properties, but most properties are optional.

The most common type of property is a simple property: a name-value pair that sets an option for the part. To add a property to a part, at the beginning of the part definition, list the name of the property and the value for the property within braces ({ }). If you specify more than one property for the part, separate the name-value pairs with commas:
DataItem cost money(10,2) 
    {Currency = yes,
     CurrencySymbol = "$"}
end
The code block that begins with the opening brace and ends with the closing brace (that is, the list of properties and their values) is referred to as a set-value block.

Properties are useful only in specific situations. For example, DataItem parts can include properties that apply only to specific types of user interfaces. As in the previous example, you can specify the properties currency and currencySymbol on any DataItem part to indicate that the DataItem represents a currency value and to specify the monetary symbol used in displaying the value.

Property values

You must provide a valid value for each property. Some properties accept string literals, some accept a "yes" or "no" value, some accept values from lists of options called enumerations, and others accept array literals. In most cases, you cannot use a variable or constant as the value of a property. In other words, you cannot use a Boolean variable or a string variable set to "yes" or "no" for the value of the currency property; you must specify a literal, unquoted "yes" or "no" value.

For a few properties, you must supply the name of a variable or part as a value. In these cases, the property is not using the value of the variable or part; it is referring to the variable or part itself.

Some properties are provided for compatibility with previous versions or migrated code and are unnecessary for new EGL applications. To know which properties are provided for new code and which are used for compatibility, see the topic in the Reference section that covers a particular part and its properties.

Inheriting and overriding properties

When you create a part that is based on another part, the new part inherits the properties of the old part:
DataItem myRedVar int {color = red} end

Record myRedRecord type BasicRecord
    myField myRedVar;
end
In this example, the field myField functions as though you specified the color property on it.
However, properties do not transfer between most variables:
myRedInt int {color = red};
myBlueInt int {color = blue};
myBlueInt = myRedInt;
In this example, myBlueInt still has the color property set to blue.

Reference variables are an exception to property transfers. For more information, see "Properties" in the Reference section.

You can explicitly override properties:
DataItem myRedVar int {color = red} end

Record myBlueRecord type BasicRecord
    myField myRedVar {color = blue};
end
In this example, the myField field overrides the red value with the blue value.
In this way, it is legal but not recommended to define a property twice for one part or variable. The last property specification sets the value:
myBlueVar int {color = red, color = blue};
In this example, the color property of the variable is set to blue because the second definition overrides the first.

Feedback