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.
{
"OpenAlg" :
{
"tOb" :
{
"id" : "S1!M!231264"
},
"tArg" :
{
"args" :
{
"openForEdit" : "true"
}
}
}
}
{
"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: