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

AF SDK Reference

AFPlugIn.CreateAnalysisRuleInstance Method

  • Last UpdatedNov 18, 2025
  • 3 minute read
AFPlugIn.CreateAnalysisRuleInstance Method
Create an AFAnalysisRule instance of a plugin.

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

Syntax

public AFAnalysisRule CreateAnalysisRuleInstance(
	AFObject context,
	string configString
)
Public Function CreateAnalysisRuleInstance ( 
	context As AFObject,
	configString As String
) As AFAnalysisRule

Dim instance As AFPlugIn
Dim context As AFObject
Dim configString As String
Dim returnValue As AFAnalysisRule

returnValue = instance.CreateAnalysisRuleInstance(context, 
	configString)
public:
AFAnalysisRule^ CreateAnalysisRuleInstance(
	AFObject^ context, 
	String^ configString
)
member CreateAnalysisRuleInstance : 
        context : AFObject * 
        configString : string -> AFAnalysisRule 

Parameters

context
Type: OSIsoft.AFAFObject
The context object that owns the plugin instance. If specified it must be either a AFAnalysisTemplate or AFAnalysis. If , then the plugin instance is not associated with any object and executes without any context.
configString
Type: SystemString
The configuration string used to initialize the plugin instance. If , then the instance will be initialized to its default values.

Return Value

Type: AFAnalysisRule
Returns the newly created plugin AFAnalysisRule instance.

Remarks

Typically, it is not necessary to invoke this method, as plugin instances are created for you through SDK objects. However, in special cases, such as constructing a composite Analysis Rule, Time Rule, or Data Reference, it may be useful to invoke other plugins directly.

Before a plugin type can be used in function, its type must be defined or an exception will be thrown at runtime. To avoid this runtime error and make sure the plugin type is loaded by making a call to the GetPlugInType method before any function is called which uses the plugin type.

Note Notes to Callers
This method cannot be used to create child AFAnalysisRule instances. Use the Add(AFPlugIn) method of the AnalysisRules collection to add child analysis rules.

Version Information

AFSDK


See Also

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in