IValidationFilters.Add

Syntax

Add(Filter: Object);

Parameters

Filter. Validation filter.

Description

The Add method adds filter to the collection.

Example

Executing the example requires that the repository contains a time series database with the TSDB identifier that contains a validation rule with the VALID_MISSING_DATA andVALID_GROWTH_RATE identifiers.

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

Sub UserProc;
Var
    Mb: IMetabase;
    RubDescr: IMetabaseObjectDescriptor;
    CreateInfo: IMetabaseObjectCreateInfo;
    ValidGroupObj: IMetabaseObject;
    ValidGroup: IValidationGroup;
    ValidFilters: IValidationFilters;
    FilterDescr: IMetabaseObjectDescriptor;
    ValidExecSett: IValidationExecuteSettings;
    ValidExecRun: IValidationExecRun;
Begin
    
// Get repository
    Mb := MetabaseClass.Active;
    
// Get time series database
    RubDescr := Mb.ItemById("TSDB");
    
// Create a validation group
    CreateInfo := Mb.CreateCreateInfo;
    CreateInfo.ClassId := MetabaseObjectClass.KE_CLASS_VALIDATIONGROUP;
    CreateInfo.Parent := RubDescr;
    CreateInfo.Permanent := 
True;
    
// Set up validation group
    ValidGroupObj := Mb.CreateObject(CreateInfo).Edit;
    ValidGroup := ValidGroupObj 
As IValidationGroup;
    
// Add validation rules to group
    ValidFilters := ValidGroup.ValidationFilters;
    FilterDescr := Mb.ItemByIdNamespace(
"VALID_MISSING_DATA", RubDescr.Key);
    ValidFilters.Add(FilterDescr);
    FilterDescr := Mb.ItemByIdNamespace(
"VALID_GROWTH_RATE", RubDescr.Key);
    ValidFilters.Add(FilterDescr);
    
// Save changes
    ValidGroupObj.Save;
    
// |Execute validation group
    ValidExecSett := New ValidationExecuteSettings.Create;
    ValidExecRun := ValidGroup.Execute(ValidExecSett);
End Sub UserProc;

After executing the example a group of validation filters, composed of two filters, is created. This group is executed, execution results are saved.

See also:

IValidationFilters