EvaluateRule(Rule: IMetaDataRule; Var AttributeName: String): Boolean;
Rule- checked rule.
AttributeName - attribute name, on which the rule is based is returned by this parameter.
The EvaluateRule method checks the specified rule of the dictionary. It returns True if the rule is executed. If the rule is not executed, the attribute, on which the rule is based, is returned by the AttributeName parameter, the EvaluateRules method returns False.
Executing the example requires that the repository contains a time series database with the OBJ_FC identifier. Rules must be specified for time series dictionary of this time series database.
Sub Main;
Var
Mb: Imetabase;
RubD: IMetabaseObjectDescriptor;
RubrIn: IRubricatorInstance;
DictInst: IMetaDictionaryInstance;
MDD: IMetaDictionaryData;
Rule: IMetaDataRule;
Dict: IMetaDictionary;
Att: String;
Begin
Mb := MetabaseClass.Active;
RubD := Mb.ItemById("OBJ_FC");
RubrIn := RubD.Open(Null) As IRubricatorInstance;
DictInst := RubrIn.Facts;
MDD := DictInst.GetDataO(0);
Dict := DictInst.Dictionary;
Rule := Dict.DataRules.Item(0);
If Not MDD.EvaluateRule(Rule, Att) Then
Debug.WriteLine(Att);
End If;
End Sub Main;
After executing the example, the first rule of time series dictionary is checked on received data of the factor. If the rule is not executed, the name of the attribute it is based is displayed in the console window.
See also: