IRubricatorInstance.SaveValidationRun

Syntax

SaveValidationRun(Run: IValidationExecRun; ExecData: IValidationExecData): Integer;

Parameters

Run - data of validation calculation.

ExecData - data about validation calculation.

Description

The SaveValidationRun method saves data of validation calculation.

Example

Executing the example requires that the repository contains a time series database with the OBJ_RUBRICATOR identifier. The time series database must contain a validation filter with the OBJ_Validation identifier.

Sub Main;

Var

MB: IMetabase;

RubDesc: IMetabaseObjectDescriptor;

RubInst: IRubricatorInstance;

ValiRun: IValidationExecRun;

ValiData: IValidationExecData;

ArrVali: Array[1] Of Integer;

i: integer;

ObjVal: IMetabaseObject;

v: IValidationFilter;

Sett: IValidationExecuteSettings;

Begin

MB := MetabaseClass.Active;

RubDesc := MB.ItemById("OBJ_RUBRICATOR");

RubInst := RubDesc.Open(Null) As IRubricatorInstance;

ObjVal := MB.ItemByIdNamespace("OBJ_Validation", RubDesc.Key).Edit;

v := ObjVal As IValidationFilter;

Sett := New ValidationExecuteSettings.Create;

ValiRun := v.Execute(Sett);

ValiData := RubInst.GetValidationExecData(-1, DictionaryGetDataOptions.Create);

ValiData.Name := Validation execution;

ArrVali[0] := ObjVal.Key;

//Calculation entry is assigned to calculated validation

ValiData.ValidationKey := ObjVal.Key;

ValiData.Validations := ArrVali;

//Calculation entry is saved in DB

(ValiData As IRubricatorRecord).Save;

//By this new calculation data is saved

i := RubInst.SaveValidationRun(ValiRun, ValiData);

Debug.WriteLine(Key of validation calculation + i.ToString);

End Sub Main;

After executing the example validation is calculated, calculation data is saved. The key of validation calculation is displayed in the console window.

See also:

IRubricatorInstance