GetAlgResult GetAlg(AlgId tAlg, GetAlgArg tArg)
tAlg. Moniker of indicators calculation algorithm instance or its block instance.
tArg. Operation execution parameters.
The GetAlg opearation gets indicators calculation algorithm metadata or its block metadata.
To execute the operation, in the tAlg field specify moniker of indicators calculation algorithm or its block used in the calculation algorithm and created in the repository, and in the tArg.pattern field specify the pattern that will be used to get metadata. The moniker can be obtained on executing the OpenAlg operation.
The operation results in the requested metadata.
Below is the example of getting indicators calculation algorithm metadata. The request contains moniker of opened calculation algorithm instance and the pattern that determines which metadata should be obtained. The response contains the obtained information.
{
"GetAlg" :
{
"tAlg" :
{
"id" : "S1!M!S!C1"
},
"tArg" :
{
"pattern" :
{
"obInst" : "true",
"params" : "Get",
"calcBlock" :
{
"dest" :
{
"stub" : "true"
}
},
"algorithm" :
{
"tree" : "Get",
"branchCondition" : "Get"
}
}
}
}
}
{
"GetAlgResult" :
{
"id" :
{
"id" : "S1!M!S!C1"
},
"meta" :
{
"obInst" :
{
"obDesc" :
{
"@ds" : "",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "40",
"@hf" : "0",
"i" : "AREA_ALG",
"n" : "Algorithm for calculating data area indicators",
"k" : "231264",
"c" : "268033",
"p" : "231226",
"h" : "0",
"hasPrv" : "0",
"ic" : "0",
"trackElementDependents" : "0",
"isPermanent" : "1",
"isTemp" : "0"
}
},
"dirty" : "0",
"calcObject" :
{
"k" : "231264",
"id" : "AREA_ALG",
"n" : "Algorithm for calculating data area indicators",
"vis" : "1",
"type" : "Algorithm",
"params" :
{
"its" :
{
"it" :
[
{
"k" : "1",
"id" : "PARAM0",
"n" : "Period",
"vis" : "1",
"dataType" : "2",
"defaultValueSelection" : "S1!M!S!S5",
"linkedObjectKey" : "104891",
"linkedStubKey" : "-1",
"hidden" : "0",
"tag" : "",
"attrs" :
{
"its" :
{
"it" :
[
{
"k" : "1",
"id" : "BLOCK_TYPE",
"n" : "Calendar block type",
"vis" : "1",
"dt" : "2"
},
{
"k" : "2",
"id" : "START_DATE",
"n" : "Period start date",
"vis" : "1",
"dt" : "4"
},
{
"k" : "3",
"id" : "NAME",
"n" : "Calendar element name",
"vis" : "1",
"dt" : "1"
},
{
"k" : "4",
"id" : "ID",
"n" : "Identifier",
"vis" : "1",
"dt" : "1"
},
{
"k" : "5",
"id" : "ORDER",
"n" : "Order",
"vis" : "1",
"dt" : "2"
},
{
"k" : "6",
"id" : "PERIOD",
"n" : "Period",
"vis" : "1",
"dt" : "4"
},
{
"k" : "7",
"id" : "YEAR",
"n" : "Year number",
"vis" : "1",
"dt" : "2"
},
{
"k" : "8",
"id" : "HALF_OF_YEAR",
"n" : "Half-year number",
"vis" : "1",
"dt" : "2"
},
{
"k" : "9",
"id" : "QUARTER",
"n" : "Quarter number",
"vis" : "1",
"dt" : "2"
},
{
"k" : "10",
"id" : "MONTH",
"n" : "Month number",
"vis" : "1",
"dt" : "2"
}
]
}
},
"index" : "0"
}
]
}
},
"algorithm" :
{
"calcTree" :
{
"nodes" :
{
"its" :
{
"it" :
[
{
"k" : "231264",
"n" : "Algorithm for calculating data area indicators",
"type" : "CalcObject",
"objType" : "Algorithm",
"included" : "1",
"readOnly" : "0"
},
{
"k" : "231264:231265",
"n" : "Indicator",
"type" : "CalcObject",
"objType" : "CalcBlock",
"objKey" : "231265",
"parentKey" : "231264",
"included" : "1",
"index" : "0",
"readOnly" : "0",
"canMoveDown" : "0",
"canMoveUp" : "0"
}
]
}
}
},
"workspace" : "S1!M!S!C1!W"
}
}
}
}
}
public static GetAlgResult GetAlgoMetadata(string moniker)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var tGet = new GetAlg()
{
tArg = new GetAlgArg()
{
pattern = new AlgMdPattern()
{
calcBlock = new AlgCalcBlockPattern()
{
dest = new AlgCalcBlockDestPattern()
{
stub = true
}
},
algorithm = new AlgCalcAlgPattern()
{
branchCondition = ListOperation.Get,
tree = ListOperation.Get
},
@params = ListOperation.Get
}
},
tAlg = new AlgId() { id = moniker }
};
//Get metadata
var result = somClient.GetAlg(tGet);
return result;
}
See also: