Custom Attributes

Custom attributes provide a way of associating business-level metadata with schemas, classes, properties and relationships. One of the custom attributes commonly applied to classes is an instance label. An instance label specifies the text to be output for instances of a class in the Items Browser and other GUI. The instance label defined for the Employee class below specifies that the value of the FullName property is to be output.


One of the custom attributes commonly applied to properties is a calcutated expression whose resultant value is assigned to the property. Often times, the expressions reference properties of the instance or a related instance. For the case below, the value to be assigned to the FullName property is defined as a concatenation of the values assigned to LastName and FirstName properties, separated by a space.


There are a number of other pre-defined custom attributes that are available, some of which are shown below.


Additionally, users can create and assign their own custom attributes. This is accomplished by first creating a specialized custom attribute class. An example of a user-defined custom attribute is shown below.


Notice IsCustomAttributeClass is set to indicate that the class defines a custom attribute. As shown below, a custom attribute can have multiple properties associated with them.


Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.