Opening Calculation Algorithm for Edit

Below is the example of using the OpenAlg operation to open an indicators calculation algorithm. The request contains moniker of the object that is calculation algorithm. The response contains moniker of opened calculation algorithm opened for edit. Any additional metadata is not obtained.

The C# example uses the FindObjectById function, which code is given in the Getting Object Description by Its Identifier section.

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">
<OpenAlg xmlns="http://www.fsight.ru/PP.SOM.Som">
<tOb xmlns="">
  <id>S1!M!231264</id>
  </tOb>
<tArg xmlns="">
<args>
  <openForEdit>true</openForEdit>
  </args>
  </tArg>
  </OpenAlg>
  </s:Body>
  </s:Envelope>

SOAP response:

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

JSON request:

{
"OpenAlg" :
{
"tOb" :
{
"id" : "S1!M!231264"
},
"tArg" :
{
"args" :
{
"openForEdit" : "true"
}
}
}
}

JSON response:

{
"OpenAlgResult" :
{
"id" :
{
"id" : "S1!M!S!C1"
},
"readOnly" : "0"
}
}
public static OpenAlgResult OpenAlg(MbId mb, string algId)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var tOpen = new OpenAlg()
{
tArg = new OpenAlgArg()
{
args = new AlgOpenArgs()
{
openForEdit = true
}
},
//Create object moniker
tOb = new OdId() { id = mb.id + "!" + FindObjectById(mb, algId).k }
};
//Open indicators calculation algorithm
var result = somClient.OpenAlg(tOpen);
return result;
}

See also:

OpenAlg: Operation