IMetaDictionaryData.EvaluateRule

Syntax

EvaluateRule(Rule: IMetaDataRule; Var AttributeName: String): Boolean;

Parameters

Rule- checked rule.

AttributeName - attribute name, on which the rule is based is returned by this parameter.

Description

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.

Example

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.

Add links to the Cubes, Metabase, Rds system assemblies.

Sub UserProc;
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(NullAs 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 UserProc;

After executing the example, the first rule of indicators dictionary is checked on obtained data of the indicator. If the rule is not executed, the name of the attribute it is based is displayed in the console window.

See also:

IMetaDictionaryData