Add(Attribute: IMetaAttribute);
Attribute. Added attribute.
The Add method adds an attribute to the collection.
Executing the example requires that the repository contains a time series database with the OBJ_FC identifier. This database must contain validation filter with the OBJ_VALID_FILTER identifier.
Sub Main;
Var
Mb: IMetabase;
RubrKey: Integer;
ValidObj: IMetabaseObject;
ValidFilter: IValidationFilter;
MissingMetaData: IValidationMissingMetaData;
ValidExecSett: IValidationExecuteSettings;
ValidExecRun: IValidationExecRun;
MetaAttrValList: IMsMetaAttributeValueList;
MetaAttrFilter: IMsMetaAttributeFilter;
Rub: IRubricator;
MetaAttr: IMetaAttribute;
ValidMetaAttrs: IValidationMetaAttributes;
Begin
Mb := MetabaseClass.Active;
RubrKey := Mb.GetObjectKeyById("OBJ_FC");
ValidObj := Mb.ItemByIdNamespace("OBJ_VALID_FILTER", RubrKey).Edit;
ValidFilter := ValidObj As IValidationFilter;
ValidFilter.Level := DimCalendarLevel.None;
ValidFilter.Kind := ValidationDetailsKind.MissingMetaData;
MissingMetaData := ValidFilter.Details As IValidationMissingMetaData;
Rub := Mb.ItemById("OBJ_FC").Bind As IRubricator;
MetaAttr := Rub.Facts.Attributes.FindById("OBT");
ValidMetaAttrs := MissingMetaData.Attributes;
ValidMetaAttrs.Add(MetaAttr);
MetaAttrValList := MissingMetaData.TargetData;
MetaAttrValList.Clear;
MetaAttrFilter := MissingMetaData.Filter;
MetaAttrFilter.Clear;
ValidObj.Save;
ValidExecSett := New ValidationExecuteSettings.Create;
ValidExecRun := ValidFilter.Execute(ValidExecSett);
End Sub Main;
After executing the example the validation filter Missing Metadata is set: availability of the OBT attribute is tested for the time series when this filter is applied. This filter is executed, the execution results are saved to database.
See also: