AFTimeRule Class
- Last UpdatedNov 18, 2025
- 9 minute read
- PI System
- AF SDK 2024 R2
- Developer
The AFTimeRule provides a way to create case time periods based on user
supplied logic and configuration.

Inheritance Hierarchy
Namespace: OSIsoft.AF.Time
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
[SerializableAttribute] public abstract class AFTimeRule : AFObject, IComparable<AFTimeRule>, IAFTrace
<SerializableAttribute> Public MustInherit Class AFTimeRule Inherits AFObject Implements IComparable(Of AFTimeRule), IAFTrace Dim instance As AFTimeRule
[SerializableAttribute] public ref class AFTimeRule abstract : public AFObject, IComparable<AFTimeRule^>, IAFTrace
[<AbstractClassAttribute>] [<SerializableAttribute>] type AFTimeRule = class inherit AFObject interface IComparable<AFTimeRule> interface IAFTrace end
The AFTimeRule type exposes the following members.
Properties
| Name | Description | |
|---|---|---|
| AdditionalInfo |
This property represents the additional information associated with the event.
| |
| Analysis |
This property returns the analysis that owns this object.
| |
| AnalysisTemplate |
This property returns the analysis template that owns this object.
| |
| ConfigString |
This property represents the current configuration of the Time Rule as a string suitable
for displaying to an end-user and/or setting its configuration.
| |
| ConfigStringStored |
Returns the currently stored configuration string.
| |
| 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 AFTimeRule for display purposes.
| |
| EditorType |
This method returns the Type of the editor that is used to configure this
time rule.
| |
| HasChildren | Obsolete.
This read-only property returns if the time rule has child time 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 time rule instance is properly configured.
| |
| IsDeleted |
This read-only property indicates whether the object has been deleted.
(Inherited from AFObject.) | |
| IsInitializing |
Indicates that the AFTimeRule is in the process
of being initialized.
| |
| MergeDuplicatedItems |
When the same event is generated by multiple time rules, should we merge them? An event is considered the same
if its start and end times are the same.
| |
| Name |
Read-only property that identifies the name of the object.
| |
| Parent | Obsolete.
Returns the parent time rule which owns this time 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 Time Rule
that is easier for users to edit and that does not contain redundant information (e.g. IDs for resolution).
| |
| TimeRules | Obsolete.
This read-only property returns the child time rules.
| |
| UniqueID |
Read-only property that provides the object's ID as a String.
(Inherited from AFObject.) |
Methods
| Name | Description | |
|---|---|---|
| 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.) | |
| ErrorToLocalizedString |
Translates error code to a localized string.
| |
| FindTimeRule(AFAnalysis, Guid) |
Retrieves the AFTimeRule object from the AFAnalysis
with the specified unique identifier.
| |
| FindTimeRule(AFAnalysisTemplate, Guid) |
Retrieves the AFTimeRule object from the AFAnalysisTemplate
with the specified unique identifier.
| |
| GetEditorT |
Returns an instance of an editor of the specified type.
| |
| GetEvents |
Returns all pending AFTimeRuleEvent objects.
| |
| GetEvents(AFTimeRange) |
Returns all AFTimeRuleEvent objects for a given time range.
| |
| 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.) | |
| GetNextEvent |
Returns the next AFTimeRuleEvent that occurs relative to Now
or the previous event.
| |
| GetNextEvent(AFTime) |
Returns the next AFTimeRuleEvent that occurs at the specified time start time.
| |
| GetNextEvent(AFTimeRuleEvent) |
Returns the next AFTimeRuleEvent that occurs after the previously specified event.
| |
| 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.) | |
| GetType | Gets the Type of the current instance. (Inherited from Object.) | |
| IsTraced |
Indicates if a specified level is being traced.
| |
| Pause |
Pause the time rule until it is started again.
| |
| Pause(TimeSpan) |
Pause the time rule for a specified amount of time.
| |
| Persist |
This method returns the persistence string for the object.
(Inherited from AFObject.) | |
| RefreshConfiguration |
Refresh the configuration of the AFTimeRule.
| |
| Reset |
Clear the previous time rule event.
| |
| SetSaveConfigChangesHandler |
Set the handler used for saving ConfigString changes.
| |
| Start |
Start the time rule
| |
| Stop |
Stop the time rule; the previous rule event is cleared.
| |
| SupportsChildTimeRule | Obsolete.
Determines if the specified AFPlugIn supports adding child time 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.
|
Events
| Name | Description | |
|---|---|---|
| EventsGenerated |
Event is raised when events are generated by the time rule.
|
Remarks
The time rules are defined and implemented by AFPlugIns
which inherit from this abstract class. The AFTimeRule PlugIns
are used to provide the next start and end time of a case, given the
previous case, time, or time range.