AFNotificationRules.Add Method (String, AFNotificationRuleTemplate)
- Last UpdatedNov 18, 2025
- 2 minute read
- PI System
- AF SDK 2024 R2
- Developer
The Add method creates a new object and adds it to the collection.
Namespace: OSIsoft.AF.Notification
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public AFNotificationRule Add( string name, AFNotificationRuleTemplate template )
Public Function Add ( name As String, template As AFNotificationRuleTemplate ) As AFNotificationRule Dim instance As AFNotificationRules Dim name As String Dim template As AFNotificationRuleTemplate Dim returnValue As AFNotificationRule returnValue = instance.Add(name, template)
public: AFNotificationRule^ Add( String^ name, AFNotificationRuleTemplate^ template )
member Add : name : string * template : AFNotificationRuleTemplate -> AFNotificationRule
Parameters
- name
- Type: SystemString
The name for the new object, which must be unique within the collection. If the name ends with an asterisk (*), then a unique name will be generated based on the supplied name. See the ValidateName(String, String) method for a description of what is valid when setting the name of the object. - template
- Type: OSIsoft.AF.NotificationAFNotificationRuleTemplate
The template that is to be used to create the new AFNotificationRule object. If , then the notification rule is created without a template and properties normally defined by the template will be defined by the notification rule instead.
Return Value
Type: AFNotificationRuleReturns the newly created object that was added to the collection.
Remarks
The new object will be created with the specified name. All other
properties of the object will be set to their default value.