OpenAlgResult OpenAlg(OdId tOb, OpenAlgArg tArg)
tOb. Moniker of the repository object that is indicators calculation algorithm.
tArg. Operation execution parameters.
The OpenAlg operation opens indicators calculation algorithm.
The operation gets access to indicators algorithm structure. The operation can also be applied for calculation algorithm blocks that are created as external repository objects: calculation blocks and function blocks.
To execute the operation, in the tOb field specify moniker of the object that is calculation algorithm, calculation block, or function block, and in the tArg field specify opening parameters. The object moniker can be obtained on executing the GetObjects operation. The tArg field can be used to specify mode (view or edit), parameter values and pattern for getting metadata. The pattern specifies the information to be retrieved on executing the operation. The operation results in the opened express object instance moniker and also the metadata if an appropriate pattern was defined in the tArg.metaGet parameter on executing the operation.
Further work with the opened object instance is executed using the GetAlg and SetAlg operations. To save changes, use the SaveAlg operation.
To close the opened object instance, use the CloseAlg operation.
Below is the example of use of the operation for opening 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 example.
{
"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: