GetAlg

Syntax

GetAlgResult GetAlg(AlgId tAlg, GetAlgArg tArg)

Parameters

tAlg. Moniker of indicators calculation algorithm instance or its block instance.

tArg. Operation execution parameters.

Description

The GetAlg opearation gets indicators calculation algorithm metadata or its block metadata.

Comments

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.

Example

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.

SOAP request:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<GetAlg xmlns="http://www.fsight.ru/PP.SOM.Som">
<tAlg xmlns="">
  <id>S1!M!S!C1</id>
  </tAlg>
<tArg xmlns="">
<pattern>
  <obInst>true</obInst>
  <params>Get</params>
<calcBlock>
<dest>
  <stub>true</stub>
  </dest>
  </calcBlock>
<algorithm>
  <tree>Get</tree>
  <branchCondition>Get</branchCondition>
  </algorithm>
  </pattern>
  </tArg>
  </GetAlg>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<GetAlgResult xmlns="http://www.fsight.ru/PP.SOM.Som" xmlns:q1="http://www.fsight.ru/PP.SOM.Som" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<id xmlns="">
  <id>S1!M!S!C1</id>
  </id>
<meta xmlns="">
<obInst>
<obDesc ds="" isShortcut="0" isLink="0" ver="40" hf="0">
  <i>AREA_ALG</i>
  <n>Algorithm for calculating data area indicators</n>
  <k>231264</k>
  <c>268033</c>
  <p>231226</p>
  <h>0</h>
  <hasPrv>0</hasPrv>
  <ic>0</ic>
  <trackElementDependents>0</trackElementDependents>
  <isPermanent>1</isPermanent>
  <isTemp>0</isTemp>
  </obDesc>
  </obInst>
  <dirty>0</dirty>
<calcObject>
  <k>231264</k>
  <id>AREA_ALG</id>
  <n>Algorithm for calculating data area indicators</n>
  <vis>1</vis>
  <type>Algorithm</type>
<params>
<its>
<it>
  <k>1</k>
  <id>PARAM0</id>
  <n>Period</n>
  <vis>1</vis>
  <dataType>2</dataType>
  <defaultValueSelection>S1!M!S!S5</defaultValueSelection>
  <linkedObjectKey>104891</linkedObjectKey>
  <linkedStubKey>-1</linkedStubKey>
  <hidden>0</hidden>
  <tag />
<attrs>
<its>
<it>
  <k>1</k>
  <id>BLOCK_TYPE</id>
  <n>Calendar block type</n>
  <vis>1</vis>
  <dt>2</dt>
  </it>
<it>
  <k>2</k>
  <id>START_DATE</id>
  <n>Period start date</n>
  <vis>1</vis>
  <dt>4</dt>
  </it>
<it>
  <k>3</k>
  <id>NAME</id>
  <n>Calendar element name</n>
  <vis>1</vis>
  <dt>1</dt>
  </it>
<it>
  <k>4</k>
  <id>ID</id>
  <n>Identifier</n>
  <vis>1</vis>
  <dt>1</dt>
  </it>
<it>
  <k>5</k>
  <id>ORDER</id>
  <n>Order</n>
  <vis>1</vis>
  <dt>2</dt>
  </it>
<it>
  <k>6</k>
  <id>PERIOD</id>
  <n>Period</n>
  <vis>1</vis>
  <dt>4</dt>
  </it>
<it>
  <k>7</k>
  <id>YEAR</id>
  <n>Year number</n>
  <vis>1</vis>
  <dt>2</dt>
  </it>
<it>
  <k>8</k>
  <id>HALF_OF_YEAR</id>
  <n>Half-year number</n>
  <vis>1</vis>
  <dt>2</dt>
  </it>
<it>
  <k>9</k>
  <id>QUARTER</id>
  <n>Quarter number</n>
  <vis>1</vis>
  <dt>2</dt>
  </it>
<it>
  <k>10</k>
  <id>MONTH</id>
  <n>Month number</n>
  <vis>1</vis>
  <dt>2</dt>
  </it>
  </its>
  </attrs>
  <index>0</index>
  </it>
  </its>
  </params>
<algorithm>
<calcTree>
<nodes>
<its>
<it>
  <k>231264</k>
  <n>Algorithm for calculating data area indicators</n>
  <type>CalcObject</type>
  <objType>Algorithm</objType>
  <included>1</included>
  <readOnly>0</readOnly>
  </it>
<it>
  <k>231264:231265</k>
  <n>Indicator</n>
  <type>CalcObject</type>
  <objType>CalcBlock</objType>
  <objKey>231265</objKey>
  <parentKey>231264</parentKey>
  <included>1</included>
  <index>0</index>
  <readOnly>0</readOnly>
  <canMoveDown>0</canMoveDown>
  <canMoveUp>0</canMoveUp>
  </it>
  </its>
  </nodes>
  </calcTree>
  <workspace>S1!M!S!C1!W</workspace>
  </algorithm>
  </calcObject>
  </meta>
  </GetAlgResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"GetAlg" :
{
"tAlg" :
{
"id" : "S1!M!S!C1"
},
"tArg" :
{
"pattern" :
{
"obInst" : "true",
"params" : "Get",
"calcBlock" :
{
"dest" :
{
"stub" : "true"
}
},
"algorithm" :
{
"tree" : "Get",
"branchCondition" : "Get"
}
}
}
}
}

JSON response:

{
"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:

Working with Indicators Calculation Algorithm