IMetaDictionaryDataInfo.IsAttributeActive

Fore Syntax

IsAttributeActive(Attribute: Variant): Boolean;

Fore.NET Syntax

IsAttributeActive(Attribute: object): 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.

Fore 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.

Fore.NET Example

Executing the example requires a time series database with the FC_GROUPS identifier that contains a group attribute with the ATTR_GROUP identifier.

Imports Prognoz.Platform.Interop.Cubes;
Imports Prognoz.Platform.Interop.Rds;


Public Shared Sub Main(Params: StartParams);
Var
    mb: IMetabase;
    RubDesc: IMetabaseObjectDescriptor;
    Rub: IRubricator;
    RubrIn: IRubricatorInstance;
    Dic: IMetaDictionary;
    i: integer;
    key: System.Array;
    FactsLookup: IRubricatorFactsLookup;
    FactData: IRubricatorFactData;
    FactInfo: IMetaDictionaryDataInfo;
    Attr: IMetaAttribute;
    Memb: IMetaDataMember;
    MembGroup: IMetaDataMemberGroup;
    GroupRecord: IMetaDataMemberRecord;
Begin
    mb := Params.Metabase;
    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 As uinteger, DictionaryGetDataOptions.dgdoNone);
        FactInfo := FactData As IMetaDictionaryDataInfo;
        If FactInfo.IsAttributeActive(Attr) Then
            System.Diagnostics.Debug.WriteLine(Time series:  + FactData.Mnemo);
            Memb := FactData.Record.Members.FindById(Attr.Id);
            MembGroup := Memb As IMetaDataMemberGroup;
            System.Diagnostics.Debug.WriteLine(  group attribute value:  + MembGroup.SelfValue);
            GroupRecord := MembGroup.GroupRecord;
            System.Diagnostics.Debug.WriteLine(  availability for editing:  + GroupRecord.IsEdited.ToString());
        End If;
    End For;
End Sub;

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