Accessing Rule Configuration Data in Rule Configuration Modules and Analysis Modules

The TestStand Sequence Analyzer passes a RuleConfigurationContext object to the rule configuration module. After calling a VI, the sequence analyzer checks the Error Out cluster output and reports an error if the status indicates that an error occurred. After calling a function, the sequence analyzer checks the return value and reports an error if the bool value is False or if the int value is not 0.

To save custom rule settings, the rule configuration module first uses the RuleConfigurationContext.RuleConfiguration property to retrieve the rule configuration. The rule configuration module adds setting values to the RuleConfiguration.ConfigurationData PropertyObject, which is initially an empty container. When the user configures the rule, the rule configuration module adds subproperties to the PropertyObject that corresponds to the custom rule settings.

To use custom rule settings during analysis, the analysis module first uses the AnalysisContext.GetRuleConfiguration method to retrieve the rule configuration and then accesses the RuleConfiguration.ConfigurationData PropertyObject, which is an empty container if the user did not configure the rule. The analysis module uses the default setting values in this case. Otherwise, the analysis module retrieves the setting values from the subproperties of the PropertyObject. Set the RuleConfiguration.Description property in a rule configuration module to include a description of the setting values. This enables users to view the rule settings through the rule descriptions in the Rules pane or tab and populates generated reports with a description of the setting values.