Below is the example of using the OpenDim operation to open a parametric dictionary of the repository. The request contains the moniker of the object that is a dictionary and parameter values. It is expected that parameters in the dictionary structure have the YEAR_START and YEAR_FINISH identifiers. The response contains the opened dictionary moniker. Any additional data of the dictionary is not extracted.
{ "OpenDim" : { "tObject" : { "id" : "S1!M!128" }, "tArg" : { "openArgs" : { "args" : { "it" : [ { "k" : "18446744073709551615", "id" : "YEAR_START", "value" : "2000" }, { "k" : "18446744073709551615", "id" : "YEAR_FINISH", "value" : "2001" } ] } } } } }
{ "OpenDimResult" : { "id" : { "id" : "S1!M!S!S2" } } }
The OpenParamDimension function specified below opens the repository dictionary specifying parameter values. The repository connection moniker and the dictionary identifier are sent as input parameters. The parameter values used on opening the dictionary are specified in the function body. The example uses the FindObjectById function, which code is given in the Getting Object Description by Its Identifier example. The result of the operation is the result of the function.
public static OpenDimResult OpenParamDimension(MbId mb, string id) { var somClient = new SomPortTypeClient(); //Proxy object for operation execution //Operation execution parameters var tOpen = new OpenDim() { tArg = new OpenDimArg() { openArgs = new DmOpenArgs() { //Parametric dictionary parameters args = new OdArg[2] { new OdArg(){id = "YEAR_START", value = "2000", k = ulong.MaxValue}, new OdArg(){id = "YEAR_FINISH", value = "2003", k = ulong.MaxValue} } } }, tObject = new OdId() { id = mb.id + "!" + FindObjectById(mb, id).k } }; //Open parametric dictionary var tResult = somClient.OpenDim(tOpen); return tResult; }
See also: