IMsProblemCalculationSettings.RemoteCalc

Syntax

RemoteCalc: MsProblemRemoteCalc;

RemoteCalc: Prognoz.Platform.Interop.Ms.MsProblemRemoteCalc;

Description

The RemoteCalc property determines whether remote calculation of modeling problem is used on BI server.

Comments

If the property is set to 

Example

Executing the example requires that the repository contains a modeling container with the MS_REMOTECALC identifier containing a modeling problem with the CALC_PROBLEM identifier. BI server must be also deployed to the URL http://10.9.172.46/fpBI_App_v9.2x64/axis2/services/PP.SOM.Som.

Add links to the Metabase, Ms system assemblies.

Sub UserProc;
Var
    Mb: IMetabase;
    Problem: IMsProblem;
    Calculation: IMsProblemCalculationProxy;
    CalcSettings: IMsProblemCalculationSettings;
Begin
    
// Get current repository
    Mb := MetabaseClass.Active;
    
// Get modeling problem
    Problem := Mb.ItemByIdNamespace("CALC_PROBLEM", Mb.GetObjectKeyById("MS_REMOTECALC")).Bind As IMsProblem;
    
// Set problem calculation parameters
    CalcSettings := Problem.CreateCalculationSettings;
    
// Determine that calculation is executed on the specified BI server
    CalcSettings.RemoteCalc := MsProblemRemoteCalc.Enable;
    
// Set connection parameters to BI server
    Calculation := Problem.Calculate(CalcSettings) As IMsProblemCalculationProxy;
    Calculation.Address := 
"http://10.9.172.46/fpBI_App_v9.2x64/axis2/services/PP.SOM.Som";
    
// If settings of remote problem calculation are successfully set, the problem is calculated
    If Calculation.IsRemoteCalc Then
        Calculation.Run;
        Debug.WriteLine(
"Problem remote calculation is executed '" + Problem.Name + "'");
    
Else
        Debug.WriteLine(
"Problem remote calculation '" + Problem.Name + "' is not executed");
    
End If;
End Sub UserProc;

Imports Prognoz.Platform.Interop.Ms;

Public Shared Sub Main(Params: StartParams);
Var
    Mb: IMetabase;
    Problem: IMsProblem;
    Calculation: IMsProblemCalculationProxy;
    CalcSettings: IMsProblemCalculationSettings;
Begin
    
// Get current repository
    Mb := Params.Metabase;
    
// Get modeling problem
    Problem := Mb.ItemByIdNamespace["CALC_PROBLEM", Mb.GetObjectKeyById("MS_REMOTECALC")].Bind() As IMsProblem;
    
// Set problem calculation parameters
    CalcSettings := Problem.CreateCalculationSettings();
    
// Determine that calculation is executed on the specified BI server
    CalcSettings.RemoteCalc := MsProblemRemoteCalc.mprcEnable;
    
// Set connection parameters to BI server
    Calculation := Problem.Calculate(CalcSettings) As IMsProblemCalculationProxy;
    Calculation.Address := 
"http://10.9.172.46/FPBI_App_v9.2x64/axis2/services/PP.SOM.Som";
    
// If settings of remote problem calculation are successfully set, the problem is calculated
    If Calculation.IsRemoteCalc Then
        Calculation.Run();
        System.Diagnostics.Debug.WriteLine(
"Problem remote calculation is executed '" + Problem.Name + "'");
    
Else
        System.Diagnostics.Debug.WriteLine(
"Problem remote calculation '" + Problem.Name + "' is not executed");
    
End If;
End Sub;

After executing the example, modeling problem calculation will be executed remotely on the specified BI server.

See also:

IMsProblemCalculationSettings