Type to start searching...

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 : identifier

Attribute 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 : boolean

True 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 : string

String identifier of the user-friendly name of the attribute.

This property may refer to a string id for internationalization.
cascade : cascade

Determines 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 : string

Attribute category.

collection : boolean

True if the attribute stores a collection of objects.

Example


The addrs attribute on the Person Class is a collection.

compatibility : compatibility

Backward 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 : boolean

True if the values are constrained to those provided by the enumeration.

dependency : string

Determines 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 : string

Attribute description.

enumeration : identifier

Class 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 : boolean

True if the attribute is an extension attribute.

facets : string

Facets with values and overrides: <name1> (<name2> <value2> value|list|assoc) ... Override defaults to value if not specified.

initializer : code

Expression 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 : languageType

The 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

name : identifier

Attribute 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 : string

Replaces 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 : positiveInt

Column 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 : boolean

True to record access to this attribute in the audit log.

readOnly : boolean

True to prohibit direct updates to the attribute value.

readPrivilege : string

Privilege required to read the value of this attribute.

required : boolean

True if the value cannot be empty for the instance to be committed.

Example


The lastName attribute on the Patient Class is required.

reverse : identifier

Attribute 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 : unsignedByte

Decimal number scale.

static : boolean

True 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 : identifier

Primitive 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 : boolean

True to record modifications to this attribute in the audit log.

Modifications over RPC are audited as resulting from direct user actions.
updatePrivilege : string

Privilege required to update the value of this attribute.

validation : code

Validation 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 : code

Expression 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 : visibility

Public attribute values can be accessed by the clients through RPC, protected ones only within the server.

Valid values based on“string”.
public
protected
where : string

Where clause applied to the instances of the attribute type class.

Parents
  • Attributes - Collection of Attributes on a Class or Aspect