IAlgorithmCalculationResult.ToJson

Syntax

ToJson: String;

None;

Description

The ToJson method returns the result of algorithm calculation in the JSON format.

Comments

The algorithm calculation results in the JSON format contains values of properties of the IAlgorithmCalculationResult and IAlgorithmTimeResult interfaces.

Example

Executing the example requires that the repository contains a ready calculation algorithm with the ALGORITHM identifier. The calculation algorithm should contains configured objects.

Add a link to the Calculation Algorithm Core custom assembly contained in the Calculation Algorithms component, and links to the Algo, Metabase system assemblies.

Sub UserProc;
Var
    
MB: IMetabase;
    MObj: IMetabaseObjectDescriptor;
    Algo: ICalcObject;
    CalcAlgo: ICalcAlgorithm;
    CalcResult: IAlgorithmCalculationResult;
Begin
    MB := MetabaseClass.Active;
    
// Get calculation algorithm
    MObj := MB.ItemById("ALGORITHM");
    Algo := CalcObjectFactory.CreateCalcObject(MObj, 
True);
    CalcAlgo := Algo 
As ICalcAlgorithm;
    
// Calculate algorithm
    CalcResult := CalcAlgo.Calculate;
    
// Display algorithm calculation result in the JSON format in the console
    Debug.WriteLine(CalcResult.ToJson);
End Sub UserProc;

Not provisioned.

After executing the example, the calculation algorithm is calculated. The console displays the algorithm calculation results in the JSON format, for example:

{"error":[], "warnings":[], "load":[{"name":"Filter", "id":"FILTER", "key":52069, "executeMilisecods":46},{"name":"Cube", "id":"CUBE", "key":52078, "executeMilisecods":12}], "calc":[{"name":"Calculation block", "id":"CALC", "key":52149, "executeMilisecods":42}], "save":[{"name":"Cube", "id":"CUBE", "key":52078, "executeMilisecods":113}], "initMilliseconds":156,"totalElapsedMilliseconds":391,"elapsedMilliseconds":16}

See also:

IAlgorithmCalculationResult