IMsModel.Execute

Syntax

Execute(Calculation: IMsModelCalculation; ScenarioKey: Integer; [Options: Integer = 0]);

Parameters

Calculation. Model calculation parameters.

ScenarioKey. Scenario key, based on which the model must be calculated.

Options. Additional model calculation options. Optional parameter, default value is 0.

Description

The Execute method executes the model.

Example

Executing the example requires that the repository contains a modeling container with the OBJ_TRANSFORM identifier. This container includes a model with the OBJ_MODEL identifier.

Sub UserProc;
Var
    ActiveMetabase: IMetabase;
    ModelCont: IMetabaseObjectDescriptor;
    Descript: IMetabaseObjectDescriptor;
    Obj: IMetabaseObject;
    Model: IMsModel;
    Calcul: IMsModelCalculation;
    Per: IMsModelPeriod;
Begin
    ActiveMetabase := MetabaseClass.Active;
    ModelCont := ActiveMetabase.ItemById("OBJ_TRANSFORM");
    Descript := ActiveMetabase.ItemByIdNamespace("OBJ_MODEL", ModelCont.Key);
    Obj := Descript.Bind;
    Model := Obj As IMsModel;
    Calcul := Model.CreateCalculation;
    Per := Calcul.Period;
    Per.IdentificationStartDate := DateTime.ComposeDay(200011);
    Per.IdentificationEndDate := DateTime.ComposeDay(200411);
    Per.ForecastStartDate := DateTime.ComposeDay(200511);
    Per.ForecastEndDate := DateTime.ComposeDay(200711);
    Calcul.CurrentPoint := DateTime.ComposeDay(200511);
    Model.Execute(Calcul, -1);
End Sub UserProc;

After executing the example the OBJ_MODEL model is calculated.

See also:

IMsModel