IMetaDictionaryDataInfo.IsAttributeActive

Syntax

IsAttributeActive(Attribute: Variant): Boolean;

Parameters

Attribute. Attribute.

Description

The IsAttributeActive method returns whether a specified group attribute is available for the factor.

Comments

If IsAttributeActive returns True, a group attribute is available for the factor.

The following items can be passed as a value of the Attribute parameter:

The IMetaDictionaryDataInfo method returns whether the time series is included in the specified group.

Example

Executing the example requires a time series database with the FC_GROUPS identifier that contains a group attribute with the ATTR_GROUP identifier. Add links to the Metabase, Rds, Cubes system assemblies.

Sub UserProc;
Var
    mb: IMetabase;
    RubDesc: IMetabaseObjectDescriptor;
    Rub: IRubricator;
    RubrIn: IRubricatorInstance;
    Dic: IMetaDictionary;
    i: Integer;
    key: Array Of Integer;
    FactsLookup: IRubricatorFactsLookup;
    FactData: IRubricatorFactData;
    FactInfo: IMetaDictionaryDataInfo;
    Attr: IMetaAttribute;
    Memb: IMetaDataMember;
    MembGroup: IMetaDataMemberGroup;
    GroupRecord: IMetaDataMemberRecord;
Begin
    mb := MetabaseClass.Active;
    RubDesc := mb.ItemById("FC_GROUPS");
    Rub := RubDesc.Bind As IRubricator;
// Receive database  time series  dictionary
    Dic := (Rub.Facts As IMetabaseObject).Edit As IMetaDictionary;
// Receive group attribute of time series   
    Attr := Dic.Attributes.FindById("ATTR_GROUP");
// Receive array of time series keys   
    RubrIn := RubDesc.Open(NullAs IRubricatorInstance;
    FactsLookup := RubrIn.CreateFactsLookup;
    i := FactsLookup.LookupFactors.Length;
    key := New Integer[i];
    key := FactsLookup.LookupFactors;
    For Each i In key Do
        FactData := RubrIn.GetFactData(i);
        FactInfo := FactData As IMetaDictionaryDataInfo;
        If FactInfo.IsAttributeActive(Attr) Then
            Debug.WriteLine(Time series:  + FactData.Mnemo);
            Memb := FactData.Record.Members.FindById(Attr.Id);
            MembGroup := Memb As IMetaDataMemberGroup;
            Debug.WriteLine(  group attribute value:  + MembGroup.SelfValue);
            GroupRecord := MembGroup.GroupRecord;
            Debug.WriteLine(  availability for editing:  + GroupRecord.IsEdited.ToString);
        End If;
    End For;
End Sub UserProc;

After executing the example value and availability for editing a group attribute for all time series included in the group are displayed in the console window.

See also:

IMetaDictionaryDataInfo