Properties

Properties are name-value pairs that EGL uses to encode specific information about a part, variable, or statement. EGL defines these properties internally in a number of different ways; EGL programmers need to know only a few important distinctions:

This documentation uses the term "properties" in a loose sense to refer to all the above variations.

You can set any of these properties in a set-value block, which is described more fully in Set-value blocks. For more information about the properties and values available for a specific part or statement, see the specific property topics for those parts and statements.

The set of valid properties varies by context:

You cannot access simple or complex properties at run time. (You may be able to access implicit fields.) For example, when you create variables that are stereotyped for relational database records, the logic that you write cannot retrieve or change the names assigned to the tableNames property, which identifies the database tables that are accessed by the record. Even if you override a property value in a variable declaration, your program logic cannot change the value that you specify at development time.

The lack of runtime access to such property values means that when you assign the content of a variable or use the variable as a parameter, the property value is not transferred along with the content. Similarly, when you pass a record to an EGL function, the parameter receives the field contents, but retains the properties that were assigned at development time. In other words, the function cannot see any overrides the program has made to record properties.

Variable names and properties

When you assign the name of an EGL variable to a property, use the variable name directly (do not put quotation marks around the name; quotation marks indicate a literal string). Observe this rule with the following properties, among others:
Rich UI handler stereotype
onConstructionFunction, validationByPassFunctions, validatorFunction, viewRootVar .
SQLRecord Stereotype
keyItems
Other properties
msgField, numElementsItem, selectedIndexItem, selectedRowItem, selectedValueItem , selectFromListItem, validatorFunction, redefines

Complex properties

In some cases you can specify generation characteristics by assigning a complex property (composed of a set of property fields). The following example declares an EGL service and defines the xml complex property, which contains the details needed to provide access to the service:
myService ExampleService {
   @xml {
      name="HelloWorld",
      namespace="http://my.website/services"} }
...
end

You cannot access either the complex property or its property fields at run time.

Assignment and properties

Properties do not transfer when you assign one value variable to another value variable. Consider the following scenario:
  myVar1 INT {color = red} = 5;
  myVar2 INT {color = blue} = 2;

  myVar1 = myVar2;

After the assignment, myVar1 has a value of 2 and a color of red.

The same thing happens when you pass a variable as an argument to a function. The function receives the value of the variable, but none of its properties.

Reference variables behave differently. When you assign properties to a reference variable, you assign them to the object the variable is pointing to. After an assignment, a second reference variable points to the same object. The following example shows a reference variable assignment:
myDictionary1 Dictionary { caseSensitive=NO };
myDictionary2 Dictionary { caseSensitive=YES };

myDictionary1 = myDictionary2;

After the assignment, myDictionary1 points to the same Dictionary part as myDictionary2, so myDictionary1 is now case sensitive.


Feedback