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

AF SDK Reference

AFAnalysisRule.CollectElements Method

  • Last UpdatedNov 18, 2025
  • 2 minute read
AFAnalysisRule.CollectElements Method
This method collects the elements that are active for the current case.

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

Syntax

public virtual bool CollectElements()
Public Overridable Function CollectElements As Boolean

Dim instance As AFAnalysisRule
Dim returnValue As Boolean

returnValue = instance.CollectElements()
public:
virtual bool CollectElements()
abstract CollectElements : unit -> bool 
override CollectElements : unit -> bool 

Return Value

Type: Boolean
Returns if the operation was successful. Any messages generated during the collection process will be output using AFTrace.

Remarks

The default implementation uses the IsActiveElement(AFElement) method to determine which elements are active for the AFCase. The analysis rule is able to override this method and implement a different criteria for determining active elements. When overriding this method, use the AddElement protected method to add elements to the case's Elements collection.

The case's Elements collection is already cleared and is ready for the Analysis Rule to add back the active elements.

Version Information

AFSDK


See Also

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