Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AF SDK Reference

AFAttributeTrait Class

  • Last UpdatedNov 18, 2025
  • 9 minute read
AFAttributeTrait Class
A trait can be used to define and/or find related AFAttribute objects with well-known behaviors and relationships.

Inheritance Hierarchy

SystemObject
  OSIsoft.AF.AssetAFAttributeTrait

Namespace:  OSIsoft.AF.Asset
Assembly:  OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182

Syntax

public class AFAttributeTrait
Public Class AFAttributeTrait

Dim instance As AFAttributeTrait
public ref class AFAttributeTrait
type AFAttributeTrait =  class end

The AFAttributeTrait type exposes the following members.

Properties

  NameDescription
Public property
Abbreviation
The abbreviation of the AFAttributeTrait.
Public propertyStatic member
AllAnalyses
The list of all analysis attribute traits.
Public propertyStatic member
AllHealth
The list of all health attribute traits.
Public propertyStatic member
AllLimits
The list of all limit attribute traits.
Public propertyStatic member
AllLocations
The list of all location attribute traits.
Public propertyStatic member
AllOther
The list of all other attribute traits.
Public property
AllowChildAttributes
Indicates if the AFAttribute with this trait defined is allowed to have child attributes.
Public property
AllowDisplayDigits
Indicates if the AFAttribute with this trait defined is allowed to define a value for DisplayDigits.
Public property
AllowDuplicates
Indicates if the parent AFAttribute is allowed to have duplicates of this trait defined.
Public propertyStatic member
AllTraits
The list of all attribute traits.
Public propertyStatic member
AnalysisStartTriggerExpression
The AFAttributeTrait that defines the StartTriggerExpression analysis attribute trait.
Public propertyStatic member
AnalysisStartTriggerName
The AFAttributeTrait that defines the StartTriggerName analysis attribute trait.
Public propertyStatic member
Forecast
The AFAttributeTrait that defines the Forecast attribute trait.
Public propertyStatic member
HealthScore
The AFAttributeTrait that defines the Health Score attribute trait.
Public propertyStatic member
HealthStatus
The AFAttributeTrait that defines the Health Status attribute trait.
Public property
IsAllowedOnRootAttribute
Indicates if the trait is allowed on a root AFAttribute.
Public property
IsTypeInherited
Indicates if the Type and TypeQualifier are inherited from the parent AFAttribute.
Public property
IsUOMInherited
Indicates if the DefaultUOM is inherited from the parent AFAttribute.
Public propertyStatic member
LimitHi
The AFAttributeTrait that defines the Hi limit attribute trait.
Public propertyStatic member
LimitHiHi
The AFAttributeTrait that defines the HiHi limit attribute trait.
Public propertyStatic member
LimitLo
The AFAttributeTrait that defines the Lo limit attribute trait.
Public propertyStatic member
LimitLoLo
The AFAttributeTrait that defines the LoLo limit attribute trait.
Public propertyStatic member
LimitMaximum
The AFAttributeTrait that defines the Maximum limit attribute trait.
Public propertyStatic member
LimitMinimum
The AFAttributeTrait that defines the Minimum limit attribute trait.
Public propertyStatic member
LimitTarget
The AFAttributeTrait that defines the Target limit attribute trait.
Public propertyStatic member
LocationAltitude
The AFAttributeTrait that defines the Altitude location attribute trait.
Public propertyStatic member
LocationLatitude
The AFAttributeTrait that defines the Latitude location attribute trait.
Public propertyStatic member
LocationLongitude
The AFAttributeTrait that defines the Longitude location attribute trait.
Public property
Name
The name of the AFAttributeTrait.
Public propertyStatic member
Reason
The AFAttributeTrait that defines the Reason attribute trait.
Public property
RequireEnumerationValue
Indicates if the AFAttribute with this trait defined must have a Type that is an AFEnumerationValue.
Public property
RequireNumeric
Indicates if the AFAttribute with this trait defined must have a Type that is numeric.
Public property
RequireString
Indicates if the AFAttribute with this trait defined must have a Type that is String.

Methods

  NameDescription
Public method
Equals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodStatic member
FindAttributeTrait
Finds the AFAttributeTrait from the specified name.
Public method
GetDefaultUOM
Gets the default UOM that is specified for the AFAttribute.
Public method
GetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public method
GetRequiredEnumerationSet
Gets the required AFEnumerationSet that is specified for the AFAttribute.
Public method
GetType
Gets the Type of the current instance.
(Inherited from Object.)
Public method
ToString
Returns a String that represents the current object.
(Overrides ObjectToString.)
Public methodStatic member
ValidateTrait
Helper function to validate if an AFAttributeTrait is valid for an attribute.

Remarks

An AFAttributeTrait can be assigned to an AFAttributeTemplate or AFAttribute to define a trait with a well-known relationship to other attributes. The following methods can be used for accessing an attribute template or attribute by trait:

The trait can also be used when referencing an attribute by path instead of needing to know the name of the attribute. For example, the path "|Pressure|[@Trait=LoLo]" would reference attribute with the LimitLoLo trait under the "Pressure" attribute.

A trait can be found by name or abbreviation using the FindAttributeTrait(String) method. Traits may also have well-known behaviors. For example, limit traits will have the same Type (see IsTypeInherited) and DefaultUOM (see IsUOMInherited) as the parent AFAttribute.

Traits are divided in to the following categories:

  • Analysis
  • Health
  • Limit
  • Location
  • Other

The Analysis traits allow the attributes that define special information about an AFAnalysis to be indicated. For example, the AnalysisStartTriggerName and AnalysisStartTriggerExpression specify which attributes contain the start trigger name and expression for the analysis. You can use the AllAnalyses property to get the list of all the analysis traits. This is a list of the analysis traits:

The Health traits allow the attributes that indicate information about the health of an asset. For example, the HealthStatus will indicate the health status of the associated asset. You can use the AllHealth property to get the list of all the health traits. This is a list of the health traits:

The Limit traits allow the attributes that define the expected range of a process variable or measurement to be defined. Limit traits have a priority with LimitMinimum having the lowest priority and LimitMaximum having the highest priority. If a limit attribute is missing, client applications will need to determine the proper behavior. For example, the absence of LimitHi could fall back to LimitHiHi which falls back to LimitMaximum. You can use the AllLimits property to get the list of all the limit traits. This is a list of the limit traits:

The Location traits allow attributes to define information about the location of an asset. This information could then be used to identify the location of the asset on a map. You can use the AllLocations property to get the list of all the location traits. This is a list of the location traits:

The Other traits are the ones that don't fit in another specific category of traits. It contains the Forecast trait which allows a predicted attribute to be placed under the measured attribute. Client applications can then automatically know how to relate these attributes. For example, the attributes could be trended together so show the actual versus the predicted values. Multiple forecast attributes can be defined for a single parent attribute and they are not required to be a future value. It also includes the Reason trait indicating the attribute that contains a reason for the state of the object. You can use the AllOther property to get the list of all the other traits. This is a list of the other traits:

The following chart shows the traits grouped by their category and indicates which behavior rules are defined for each trait.

Version Information

AFSDK

Supported in: 3.1.1, 3.1.0, 3.0.2, 3.0.1, 3.0.0, 2.10.11, 2.10.5, 2.10.0, 2.10, 2.9.5, 2.9, 2.8.5, 2.8

See Also

TitleResults for “How to create a CRG?”Also Available in