ICalcAlgorithm.Stubs

Syntax

Stubs: IVariableStubsCollection;

Description

The Stubs property returns the collection of data sources and data consumers of calculation blocks and control blocks.

Example

Executing the example requires that the repository contains a calculation algorithm with the ALGORITHM identifier. The calculation algorithm should contain the calculation blocks and control blocks with added data consumers and data sources.

Add links to the Algo, Cubes, Metabase system assemblies. Add a link to the assembly required for working with calculation algorithm.

Sub UserProc;
Var
    MB: IMetabase;
    MObj: IMetabaseObjectDescriptor;
    Algo: ICalcObject;
    CalcAlgo: ICalcAlgorithm;
    Stubs: IVariableStubsCollection;
    Stub: IVariableStub;
    i: Integer;
Begin
    MB := MetabaseClass.Active;
    // Get calculation algorithm
    MObj := MB.ItemById("ALGORITHM");
    Algo := CalcObjectFactory.CreateCalcObject(MObj, True);
    CalcAlgo := Algo As ICalcAlgorithm;
    // Get collection of data consumers and data sources of calculation blocks and control blocks
    Stubs := CalcAlgo.Stubs;
    // Display information about data consumers and data sources in the console
    For i := 0 To Stubs.Count-1 Do
        Stub := Stubs.Item(i);
        Debug.Write("Name: " + Stub.Name + ", ");
        Debug.WriteLine("number of dimensions in cube: " + Stub.DimensionCount.ToString)
    End For;
End Sub UserProc;

After executing the example the console displays information about data consumers and data sources, for example:

Name: Indicators cube, number of dimensions in cube: 2

Name: Consumer cube, number of dimensions in cube: 4

Name: Cube with controlled dimensions, number of dimensions in cube: 3

See also:

ICalcAlgorithm