Changing Calculation Algorithm Settings for Data Slice

Below is the example of changing settings of the calculation algorithm that is applied to a regular report data slice. The request contains moniker for working with calculation algorithms for data slice, key of the element corresponding to algorithm, and new settings. The response contains whether settings were changed successfully.

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">
<UpdateDataAreaExternalTransformations xmlns="http://www.fsight.ru/PP.SOM.Som">
  <mon xmlns="">FPJHEGEAILDDGOAEBNPJEFNNPNNPCPAELKNIOBNJKIPKLKBE!M!S!PDFCFFHEAILDDGOAECGFLOGBJGLOFCJHEFKJBCNDOFDGMOMON!DataArea!DataSources!1!DataSourceSlices!1!ExternalTransformations</mon>
<tArg xmlns="">
<its>
<it>
<action>
  <operation>Update</operation>
  </action>
<externalTransformation>
  <k>1</k>
  <saveDataOption>true</saveDataOption>
  <calculationPeriodMode>2</calculationPeriodMode>
  </externalTransformation>
  </it>
  </its>
  </tArg>
  </UpdateDataAreaExternalTransformations>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
  <UpdateDataAreaExternalTransformationsResult 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">1</UpdateDataAreaExternalTransformationsResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"UpdateDataAreaExternalTransformations" :
{
"mon" : "FPJHEGEAILDDGOAEBNPJEFNNPNNPCPAELKNIOBNJKIPKLKBE!M!S!PDFCFFHEAILDDGOAECGFLOGBJGLOFCJHEFKJBCNDOFDGMOMON!DataArea!DataSources!1!DataSourceSlices!1!ExternalTransformations",
"tArg" :
{
"its" :
{
"it" :
[
{
"action" :
{
"operation" : "Update"
},
"externalTransformation" :
{
"k" : "1",
"saveDataOption" : "true",
"calculationPeriodMode" : "2"
}
}
]
}
}
}
}

JSON response:

{
"UpdateDataAreaExternalTransformationsResult" : "1"
}
public static bool ChangeAlgorithmWithSlice(string moniker, uint sourceKey, uint sliceKey, uint algoItemKey, int? moveTo = null)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tUpd = new UpdateDataAreaExternalTransformations()
{
tArg = new DataAreaExternalTransformationUpdateActions()
{
its = new DataAreaExternalTransformationUpdateAction[]
{
new DataAreaExternalTransformationUpdateAction()
{
action = new DataAreaExternalTransformationUpdateActionType() { operation = DataAreaExternalTransformationUpdateActionOperation.Update, index = moveTo },
externalTransformation = new DataAreaExternalTransformation()
{
k = algoItemKey,
calculationPeriodMode = 2, // Algorithm selection
saveDataOption = true, // Save data
}
}
}
},
mon = moniker + "!DataArea!DataSources!" + sourceKey + "!DataSourceSlices!" + sliceKey + "!ExternalTransformations"
};
// Add calculation algorithm for data slice
var result = somClient.UpdateDataAreaExternalTransformations(tUpd);
return result;
}

See also:

UpdateDataAreaExternalTransformations: Operation