Properties
- A simple property communicates information to EGL
at generation time, and cannot be changed dynamically (that is, at
run time). A simple property has only a single field, value.
You can use shorthand to set this field by simply equating the property
name to an appropriate value in a set-values block (see Set-values blocks). In the following example, displayName is
a simple property:
DataItem socSecNum INT { displayName = "Social Security Number"} end - A complex property also communicates information to EGL at generation time, and cannot be changed at run time. A complex property differs from a simple property only in that it has multiple fields instead of just one. Each of these name-value pairs is called a property field. You will often see the unary @ operator preceding a complex property, indicating that the operand is a property rather than a field (see @ operator). Also see "Complex properties" in this topic.
- An implicit field is a name-value pair that resembles a property, but is not visible to the compiler at build time. Generally these implicit fields are changeable at run time. EGL adds them automatically to parts of a particular stereotype, such as exception records (see The Exception stereotype).
- There are also "pseudo-properties" in Console UI . Like simple properties, pseudo-properties are name-value pairs that you can specify when declaring certain types of variables, such as a ConsoleField. Unlike simple properties, they have no effect on generation. These pseudo-properties are often changeable at run time, though some are declared to be read only. For more information, see topics for the particular UI technology.
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-values block, which is described more fully in Set-values 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.
- Each type of part defines a set of properties; you can change
those properties to modify characteristics of the part. Each Program
part, for example, has a property named alias that
identifies the name of the compilable unit.
If a part is stereotyped, additional properties are available (see Stereotypes), not only for the part but possibly for fields within the part. For more information, see the specific data access or UI technologies for which the stereotype specializes that part.
- In some variable declarations, you can override a property that
was specified in the related part definition, but only if the property
is meaningful in that context:
- Overriding a property is possible when you declare a variable
that is based on a DataItem part (see DataItem part). Consider the following
definition:
The following statement declares a UI field of typeDataItem IDNumber CHAR(9) { minimumInput = 9, // requires 9 input characters isDecimalDigit = yes, // requires digits column = "SSN" // is related to a column } endIDNumber, but the statement does not require that the user type digits:myID IDNumber { isDecimalDigit = no };In this example, the override does not affect the minimumInput and column properties.
- You can override properties of composite parts such as Record
parts. The following example defines a record with a single field:
When you declare a variable based on this definition, you can override the value of the color property:Record TestRecord y int {color = red}; endmyRec TestRecord {y{color = black}};
- Overriding a property is possible when you declare a variable
that is based on a DataItem part (see DataItem part). Consider the following
definition:
- When you declare a primitive type variable, you can set any of the field-level properties that are useful in the context of the variable declaration.
- When you declare a record variable, you can assign the redefines property, which cannot be set when you define a part. For details on this property, see "Declaring a record variable that redefines another."
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
- Basic program
- inputRecord
- JSF handler stereotype
- onConstructionFunction, initialUI array elements.
- Rich UI handler stereotype
- onConstructionFunction, validationByPassFunctions, validatorFunction, viewRootVar .
- SQLRecord Stereotype
- keyItems
- Other properties
- msgField, numElementsItem, selectedIndexItem, selectedRowItem, selectedValueItem , selectFromListItem, validatorDataTable, validatorFunction, redefines
Complex properties
myService ExampleService {
@xml {
name="HelloWorld",
namespace="http://my.website/services"} }
...
endYou cannot access either the complex property or its property fields at run time.
Assignment and properties
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.
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.