AFAnalysisRule Class
- Last UpdatedNov 18, 2025
- 11 minute read
- PI System
- AF SDK 2024 R2
- Developer
The AFAnalysisRule defines the information needed for an
analysis of the data within a case, and executes that analysis.

Inheritance Hierarchy
Namespace: OSIsoft.AF.Analysis
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
[SerializableAttribute] public abstract class AFAnalysisRule : AFObject, IComparable<AFAnalysisRule>, IAFTrace, IAFLocalizedErrorProvider
<SerializableAttribute> Public MustInherit Class AFAnalysisRule Inherits AFObject Implements IComparable(Of AFAnalysisRule), IAFTrace, IAFLocalizedErrorProvider Dim instance As AFAnalysisRule
[SerializableAttribute] public ref class AFAnalysisRule abstract : public AFObject, IComparable<AFAnalysisRule^>, IAFTrace, IAFLocalizedErrorProvider
[<AbstractClassAttribute>] [<SerializableAttribute>] type AFAnalysisRule = class inherit AFObject interface IComparable<AFAnalysisRule> interface IAFTrace interface IAFLocalizedErrorProvider end
The AFAnalysisRule type exposes the following members.
Properties
| Name | Description | |
|---|---|---|
| Analysis |
This property returns the analysis that owns this object.
| |
| AnalysisRules |
This read-only property returns the child analysis rules.
| |
| AnalysisTemplate |
This property returns the analysis template that owns this object.
| |
| ConfigString |
This property represents the current configuration of the Analysis Rule as a string suitable
for displaying to an end-user and/or setting its configuration.
| |
| CurrentCase |
This property returns the current case associated with the AnalysisRule.
| |
| Database |
This read-only property returns the AFDatabase where this object is defined.
| |
| Description |
Read-only property that provides more detailed description of the object.
| |
| DisplayString |
Returns the configuration of the AFAnalysisRule for display purposes.
| |
| EditorType |
This method returns the Type of the editor that is used to
configure this analysis rule.
| |
| HasChildren |
This read-only property returns if the analysis rule has child analysis rules.
| |
| ID |
Read-only property that provides a unique identifier for the object to be used for
quick access that is not dependent upon the index.
(Inherited from AFObject.) | |
| Identity |
This read-only property contains identity of the object.
(Inherited from AFObject.) | |
| IsConfigured |
This method returns if the analysis rule instance is properly configured.
| |
| IsDeleted |
This read-only property indicates whether the object has been deleted.
(Inherited from AFObject.) | |
| IsInitializing |
Indicates that the AFAnalysisRule is in the process
of being initialized.
| |
| Name |
Read-only property that identifies the name of the object.
| |
| Parent |
Returns the parent analysis rule which owns this analysis rule.
| |
| PISystem |
This read-only property allows access to the PISystem associated with this
object.
(Inherited from AFObject.) | |
| PlugIn |
This read-only property returns the AFPlugIn used to create
this instance of the plugin.
| |
| SimplifiedConfigString |
This property presents a simplified view of the current configuration of the Analysis Rule
that is easier for users to edit and that does not contain redundant information (e.g. IDs for resolution).
| |
| SimplifiedVariableMapping |
This property represents a simplified view of the current variable mapping for the Analysis Rule.
Setting this property will update the VariableMapping string with updated IDs.
| |
| SupportedBehaviors |
Defines the behavior supported by this analysis rule. If the analysis rule supports child analysis rules, their supported behavior is accounted for.
| |
| UniqueID |
Read-only property that provides the object's ID as a String.
(Inherited from AFObject.) | |
| VariableMap |
A collection of AFVariableMappingDatas defined for this AFAnalysisRule.
Modifying this collection is preferred to editing the VariableMapping string directly.
| |
| VariableMapping |
This property represents the current variable mapping for the Analysis Rule.
|
Methods
| Name | Description | |
|---|---|---|
| ClearVariableMapForPasteOperation |
Clear the variable map logic when pasting the analysis rule.
| |
| CollectElements |
This method collects the elements that are active for the current case.
| |
| CollectInputs |
This method is an optional method which allows the analysis rule to obtain the
input values necessary to start an analysis.
| |
| CollectTransfers |
This method collects the transfers that are active for the current case.
| |
| CompareTo(Object) |
Compares this instance with a specified Object.
(Inherited from AFObject.) | |
| CompareTo(AFObject) |
Compares this instance with a specified AFObject.
(Inherited from AFObject.) | |
| DefaultSaveConfigChanges |
Called by the protected SaveConfigChanges method to perform the default actions to save
the configuration changes.
| |
| Equals(Object) |
Determines whether the specified Object is equal to the current object.
(Inherited from AFObject.) | |
| Equals(AFObject) |
Indicates whether the current object is equal to another object of the same type.
(Inherited from AFObject.) | |
| FindAnalysisRule(AFAnalysis, Guid) |
Retrieves the AFAnalysisRule object from the AFAnalysis
with the specified unique identifier.
| |
| FindAnalysisRule(AFAnalysisTemplate, Guid) |
Retrieves the AFAnalysisRule object from the AFAnalysisTemplate
with the specified unique identifier.
| |
| GetAttributeVariables |
Returns all the attribute variables.
| |
| GetConfiguration |
Get the configuration defined by this AFAnalysisRule for its current target.
| |
| GetConfiguration(AFObject) |
Get the configuration defined by this AFAnalysisRule for the specified target.
| |
| GetEditorT |
Returns an instance of an editor of the specified type.
| |
| GetHashCode |
Gets the hash code for this instance of the object which is suitable for use in hashing
algorithms and data structures like a hash table.
(Inherited from AFObject.) | |
| GetInputs |
This method provides the analysis rule a mechanism to specify the attributes
it will use during its analysis.
| |
| GetLocalizedError |
This method gets a localized string for errors associated with the AFAnalysisRule.
| |
| GetOutputs |
This method provides the analysis rule a mechanism to specify the attributes
it will output during its analysis.
| |
| GetOutputsForAnalyses |
Returns a mapping of AFAttributes to the AFAnalysis that outputs values to them.
| |
| GetOutputsForAnalysisTemplates |
Returns a mapping of AFAttributeTemplates to the AFAnalysisTemplate that outputs values to them.
| |
| GetPath |
Returns the full path to the object, using just the names.
(Inherited from AFObject.) | |
| GetPath(AFObject) |
Returns the path to the object relative from another object.
(Inherited from AFObject.) | |
| GetPath(AFEncodeType, AFObject) |
Returns the path to the object relative from another object,
using the name and/or id as specified
by encodeType.
(Inherited from AFObject.) | |
| GetTarget |
Get the target associated with the specified AFAnalysisRule.
| |
| GetType | Gets the Type of the current instance. (Inherited from Object.) | |
| GetVariableDefinitions |
Get the configuration defined by this AFAnalysisRule | |
| GetVariableDefinitions(AFObject) |
Get the configuration defined by this AFAnalysisRule.
| |
| IsCompatibleAsOutput |
This method returns if the specified AFAttributeTemplate
or AFAttribute is compatible as an output.
| |
| IsModelAnalysisRule | ||
| IsTraced |
Indicates if a specified level is being traced.
| |
| MapVariable(String, AFAttribute) |
Maps a variable to the specified AFAttribute.
| |
| MapVariable(String, String) |
Maps a variable to a new attribute name.
| |
| Persist |
This method returns the persistence string for the object.
(Inherited from AFObject.) | |
| Publish |
The output AFAttribute values of the analysis case run are published
to the locations specified by the attribute's data reference configuration.
| |
| RecoverAnalysisRuleState |
Initializes the analysis rule state using the specified state IAFAnalysisRuleState that needs to be recovered
for this AFAnalysisRule and its children.
| |
| RefreshConfigurationAndVariableMapping |
Refresh the configuration string and variable mapping of the AFAnalysisRule, and it's child analysis rules.
| |
| Reset |
Resets any dynamic state associated with the analysis rule.
| |
| Run |
This method executes the analysis and generates analysis results.
| |
| Run(IAFAnalysisRuleState) |
Runs the analysis using the specified IAFAnalysisRuleState object.
| |
| SetSaveConfigChangesHandler |
Set the handler used for saving ConfigString changes.
| |
| SupportsChildAnalysisRule |
Determines if the specified AFPlugIn supports adding child analysis rules.
| |
| ToString |
Returns a String that represents the current object.
(Overrides AFObjectToString.) | |
| TraceData |
Output a data trace event.
| |
| TraceDetail |
Output a detail trace event.
| |
| TraceError |
Output an error trace event.
| |
| TraceEvent(AFTraceSwitchLevel, String) |
Output a trace event with a message.
| |
| TraceEvent(AFTraceSwitchLevel, String, Int32) |
Output a trace event with a message and a duration.
| |
| TraceEvent(AFTraceSwitchLevel, String, Object) |
Output a trace event as a formatted message with a variable number of arguments.
| |
| TraceInformation |
Output an information trace event.
| |
| TraceSummary |
Output a summary trace event.
| |
| TraceWarning |
Output a warning trace event.
|
Remarks
Analysis Rules are defined and implemented by AFPlugIns
which inherit from this abstract class.