IMsCalculationChainMetaModel.ResetMetaModel

Syntax

ResetMetaModel;

Description

The ResetMetaModel method refreshes metamodel in calculation chain.

Comments

Use the method, if model parameters in repository have been changed and it should be refreshed in the calculation chain.

Example

Executing the example requires that the repository contains a modeling container with the MS identifier. This container should contain a metamodel with the CALCULATIONCHAIN identifier. The metamodel should contain a metamodel with the METAMODEL_CONVERT identifier in the calculation chain.

Add links to the Metabase, Ms system assemblies.

Sub UserProc;
Var
    mb: IMetabase;
    msKey: Integer;
    MetaModel: IMsMetaModel;
    CalculationChain: IMsCalculationChainEntries;
    ChainMetaModel: IMsCalculationChainMetaModel;
Begin
    
// Get current repository
    mb := MetabaseClass.Active;
    
// Get modeling container key including metamodel
    msKey := mb.GetObjectKeyById("MS");
    
// Get metamodel
    MetaModel := mb.ItemByIdNamespace("CALCULATIONCHAIN", msKey).Edit As IMsMetaModel;
    
// Get metamodel calculation chain
    CalculationChain := MetaModel.CalculationChain;
    
// Find metamodel by identifier in the calculation chain
    ChainMetaModel := CalculationChain.FindById("METAMODEL_CONVERT"As IMsCalculationChainMetaModel;
    
// Reset found metamodel
    ChainMetaModel.ResetMetaModel;
    
// Save changes
    (MetaModel As IMetabaseObject).Save;
End Sub UserProc;

After executing the example, the METAMODEL_CONVERT metamodel is refreshed in the calculation chain.

See also:

IMsCalculationChainMetaModel