t_Type_Attributes_Attribute
Attribute
An attribute is a structural characteristic of a class.

Description
Attributes represent the structural characteristics of classes. Class instances have a slot for each attribute. These attributes have many properties including name, initializer, type, multiplicity and value (for calculated attributes).
E.g. The Person class may have an attribute named height with a type of double and a multiplicity of non-collection.
Attribute types may be primitive (integer, string, ...) or refer to another associated class within the domain model.
e.g. Person'homeAddress may be of type Address.
If a class has a base class, it inherits all of the attributes from that base. Properties of these inherited attributes may be overridden.
Attributes are mapped to locations in persistent data sources in the class' persistence mapping.
Properties
access : identifierAttribute on the same class, which value must be non-false to allow updates to this attribute.
Valid values based on“string”. :?[\p{L}_][\p{L}\p{N}_]*(:[\p{L}_][\p{L}\p{N}_]*)* Value must begin with a letter or an underscore. Case and length are not restricted. Letters, numbers and underscores are allowed. Colon is used as a scope separator. Spaces and other punctuation characters are not allowed.
cached : booleanTrue to cache a calculated attribute value on the instance, false to calculate it every time the value is needed.
If not specified, the flag is set to true if reverse associations are available in the attribute dependency list. A non-cached attribute is read-only.caption : stringString identifier of the user-friendly name of the attribute.
This property may refer to a string id for internationalization.cascade : cascadeDetermines the deletion logic for the instances associated through this attribute.
Determines what will happen to associated class instances if the current instance is deleted. Delete the associated instances, clear the association, or cancel the deletion if there are associated instances.Valid values based on“string”. none delete clear cancel category : stringAttribute category.
collection : booleanTrue if the attribute stores a collection of objects.
- Example
The addrs attribute on the Person Class is a collection.
compatibility : compatibilityBackward compatibility: none|backward|deprecated
"backward" includes the attribute in the current versioned API. "deprecated" includes it but indicates that an alternative is preferred and that it may be excluded from future versions. "none" excludes the attribute from the current versioned API.Valid values based on“string”. none backward deprecated constrained : booleanTrue if the values are constrained to those provided by the enumeration.
dependency : stringDetermines what other attributes this attribute's value is dependent on: attr1 (assoc2 attr2_1 ...) ...
- Example
The fullName attribute is dependent on the firstName and lastName attributes.
description : stringAttribute description.
enumeration : identifierClass defining the set of valid values for this attribute. For primitive types, the "value" attribute is used.
Valid values based on“string”. :?[\p{L}_][\p{L}\p{N}_]*(:[\p{L}_][\p{L}\p{N}_]*)* Value must begin with a letter or an underscore. Case and length are not restricted. Letters, numbers and underscores are allowed. Colon is used as a scope separator. Spaces and other punctuation characters are not allowed.
extension : booleanTrue if the attribute is an extension attribute.
facets : stringFacets with values and overrides: <name1> (<name2> <value2> value|list|assoc) ... Override defaults to value if not specified.
initializer : codeExpression for setting the initial value of the attribute when the class is 'new'.
The initializer is called the first time the object is loaded if it hasn't been explicitly set. It won't happen if the object isn't 'new'.Valid values based on“string”. language : languageTypeThe scripting language for this element.
Defaults to the model scripting language.- See
- Metadata.language
Valid values based on“string”. scheme scheme scripting language
js JavaScript scripting language
logMask : stringAn optional mask for logging sensitive class attributes. Setting this value implies that this field should be treated as sensitive.
name : identifierAttribute name. Usually starts with lower case.
The attribute name must be unique within the class definition.Valid values based on“string”. :?[\p{L}_][\p{L}\p{N}_]*(:[\p{L}_][\p{L}\p{N}_]*)* Value must begin with a letter or an underscore. Case and length are not restricted. Letters, numbers and underscores are allowed. Colon is used as a scope separator. Spaces and other punctuation characters are not allowed.
orderBy : stringReplaces the sort order used in the UI for this attribute: (attr1 . asc1) ... (attrN . ascN).
- Example
"" - order ascending on this attribute
(thisAttribute . #f) - order descending on the 'thisAttribute' attribute.
lastName firstName - order the fullName calculated attribute on the lastName then the firstName attributes ascending.
(@ doctor clinic name) - order the Patients based on their doctor's clinic's names.
precision : positiveIntColumn precision (decimal, integer) or length (string, binary). For integer columns, it is the number of bytes (1, 2 or 4).
Valid values based on“int”. 1 (minInclusive) readAudit : booleanTrue to record access to this attribute in the audit log.
readOnly : booleanTrue to prohibit direct updates to the attribute value.
readPrivilege : stringPrivilege required to read the value of this attribute.
required : booleanTrue if the value cannot be empty for the instance to be committed.
- Example
The lastName attribute on the Patient Class is required.
reverse : identifierAttribute in the associated class that refers back to this instance. (for non-primitive attributes only)
If the attribute is non-primitive (i.e. refers to an associated class), the reverse property optionally specifies an attribute on the associated class that refers back to this instance. If the association is one-way then the reverse property will be left empty.
The Entity classes homePhone attribute is of type TelephoneNumber and has a reverse property of entity. This means that we can navigate from Entity to TelephoneNumber via the Entity'homePhone attribute and from TelephoneNumber to Entity via the TelephoneNumber'entity attribute in the Business Model.
If no reverse is specified, we will usually only navigate one-way.- Example
Association with a reverse
homePhone
Entity < - - - - - - - - - - - > TelephoneNumber
entity
Association without a reverse
homePhone
Entity - - - - - - - - - - - - > TelephoneNumber
Valid values based on“string”. :?[\p{L}_][\p{L}\p{N}_]*(:[\p{L}_][\p{L}\p{N}_]*)* Value must begin with a letter or an underscore. Case and length are not restricted. Letters, numbers and underscores are allowed. Colon is used as a scope separator. Spaces and other punctuation characters are not allowed.
scale : unsignedByteDecimal number scale.
static : booleanTrue to share the attribute between all the objects, false to allocate it separately for each class instance.
- Example
The StateEnum class may have a static attribute of OPEN so StateEnum'OPEN returns the caption of "Open".
type : identifierPrimitive type or another class within the domain model.
- Example
string, integer, FinancialAccount, ...- See
- For the list of primitive values, see t_Message_Parts_Value.html for the type property.
Valid values based on“string”. :?[\p{L}_][\p{L}\p{N}_]*(:[\p{L}_][\p{L}\p{N}_]*)* Value must begin with a letter or an underscore. Case and length are not restricted. Letters, numbers and underscores are allowed. Colon is used as a scope separator. Spaces and other punctuation characters are not allowed.
updateAudit : booleanTrue to record modifications to this attribute in the audit log.
Modifications over RPC are audited as resulting from direct user actions.updatePrivilege : stringPrivilege required to update the value of this attribute.
validation : codeValidation expression taking "this" and "value" as arguments and returning #f, a string id or a list of format arguments if the attribute is invalid.
Class attributes may have values tested against a validation script before saving. This validation will be consistently applied by the business model engine regardless of where the value came from - UI, integration, automated processes... The validation expression takes "this" (the current Class Instance) and "value" (the value of the attribute) as it's arguments and returns #f, a string id or a list of format arguments if the attribute is invalid.- Example
(if (not (number? value))
`("ids.numericValueError" ,value)
) ; where ids.numericValueError is "Attribute must be numeric. '{0}' is not valid."
Valid values based on“string”. value : codeExpression for calculating the attribute value.
Value is called the first time the object is referenced. It works differently for persisted vs. non-persisted attributes: a persisted attribute with a 'value' will be recalculated whenever attributes that it depends on change (see dependency); a non-persisted attribute will only be recalculated when it is requested. However, both will invalidate the value if the attributes they depend on change. i.e. If you explicitly set the value of an attribute, then change one of its dependencies, the next time you access the attribute, it will call the value function. Also, if you don't set the attribute's 'cached' property to true, the attribute will be read-only.Valid values based on“string”. visibility : visibilityPublic attribute values can be accessed by the clients through RPC, protected ones only within the server.
Valid values based on“string”. public protected where : stringWhere clause applied to the instances of the attribute type class.
Parents
t_Type_Attributes - Collection of Attributes on a Class or Aspect
Parent topic: t_Type_Attributes