OpenSegResult OpenSeg(OdId tOb, OpenSegArg tArg)
tOb. Moniker of repository object that is a cube segment.
tArg. Operation execution parameters.
The OpenSeg operation opens a cube segment.
To execute the operation, in the tOb field specify the object that is a segment, and in the tArg field specify opening parameters. The object moniker can be obtained on executing the GetObjects operation. In the tArg field one can specify opening mode (view or edit) and a pattern to get metadata. The pattern is used to specify the information that should be obtained on opening. The operation results in the moniker of opened segment instance and metadata if the tArg.metaGet field was defined on executing the operation.
Further work is executed using the GetSeg and SetSeg operations. To save changes, use the SaveObject operation.
To close the opened segment instance, use the CloseSeg operation.
Below is the example of opening cube segment for edit. The request contains moniker of repository object that is a segment. The response contains the obtained moniker of opened segment instance.
The C# example uses the FindObjectById function, which code is given in the Getting Object Description by Its Identifier article.
{
"OpenSeg" :
{
"tOb" :
{
"id" : "FLEDMHBOCLDPFOAEDMFBLHBLOEJDMKEEKKHHKBBDHHIFPONM!M!317192"
},
"tArg" :
{
"args" :
{
"bind" : "true",
"openForEdit" : "true"
}
}
}
}
{
"OpenSegResult" :
{
"id" :
{
"id" : "FLEDMHBOCLDPFOAEDMFBLHBLOEJDMKEEKKHHKBBDHHIFPONM!M!S!CNOKHLMBOCLDPFOAECLPBNGOGGLICIMAEJIEMIFKOCDIBJKCM"
},
"readOnly" : "0"
}
}
public static OpenSegResult OpenSeg(MbId mb, string id)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tOpen = new OpenSeg()
{
tArg = new OpenSegArg()
{
args = new SegOpenArgs()
{
bind = true,
openForEdit = true
}
},
tOb = new OdId() { id = mb.id + "!" + FindObjectById(mb, id).k }
};
// Open cube segment
var tResult = somClient.OpenSeg(tOpen);
return tResult;
}
See also: