IMsCalculationChainEntries.ArrangeModels

Fore Syntax

ArrangeModels(ArrangeMode: MsArrangeMode; [Problem: IMsProblem = Null]);

Fore.NET Syntax

ArrangeModels(ArrangeMode: Prognoz.Platform.Interop.Ms.MsArrangeMode;
              Problem: Prognoz.Platform.Interop.Ms.IMsProblem);

Parameters

ArrangeMode. Mode of auto building a calculation chain.

Problem. The problem, by which the calculation periods of created equation system will be set. The parameter is relevant if ArrangeMode = MsArrangeMode.CreateSystems.

Description

The ArrangeModels method automatically arranges calculation chain of models by specified parameters according to dependences between variables.

Comments

Automatic creation enables the user to find dependencies between models and create a calculation chain in accordance with these dependencies. Automatic creation ignores metamodels included into calculation chain.

Principles of automatic chain creation:

The value of the ArrangeMode parameter influences the automatic building as follows:

NOTE. If the modeling container is a child of time series database, separate use of the SplitSlices value is unavailable.

Fore Example

Executing the example requires a modeling container with the CONT_MODEL identifier containing a metamodel with the META_ARRANGE identifier. Add links to the Metabase, Ms system assemblies.

Sub UserProc;
Var
    mb: IMetabase;
    ContKey: Integer;
    MetaModel: IMsMetaModel;
    Chain: IMsCalculationChainEntries;
Begin
    mb := MetabaseClass.Active;
    ContKey := mb.GetObjectKeyById("CONT_MODEL");
    MetaModel := mb.ItemByIdNamespace("META_ARRANGE", ContKey).Edit As IMsMetaModel;
    Chain := MetaModel.CalculationChain;
    Chain.ArrangeModels(MsArrangeMode.DeleteFolders Or MsArrangeMode.SplitSlices);
    (MetaModel As IMetabaseObject).Save;
End Sub UserProc;

After executing the example the elements in calculation chain are ordered without taking into account folders, multidimensional models with cycles are divided into parts.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.Ms;

Public Shared Sub Main(Params: StartParams);
Var
    mb: IMetabase;
    ContKey: uinteger;
    MetaModel: IMsMetaModel;
    Chain: IMsCalculationChainEntries;
Begin
    mb := Params.Metabase;
    ContKey := mb.GetObjectKeyById("CONT_MODEL");
    MetaModel := mb.ItemByIdNamespace["META_ARRANGE", ContKey].Edit() As IMsMetaModel;
    Chain := MetaModel.CalculationChain;
    Chain.ArrangeModels(MsArrangeMode.mamDeleteFolders Or MsArrangeMode.mamSplitSlices, Null);
    (MetaModel As IMetabaseObject).Save();
End Sub;

See also:

IMsCalculationChainEntries