Below is the example of using the OpenMs operation to open a modeling container. The request contains a container moniker. The response contains moniker of opened modeling container instance. Any additional data is not obtained.
{ "OpenMs" : { "tOb" : { "id" : "DHBHAJPMANJBFOAEDNFOJNMAGMDOKOGEAIHDMOJANENOLHHL!M!1581" }, "tArg" : { "args" : { "onlyProblem" : "false" }, "metaGet" : { "obInst" : "true", "items" : "Get" } } } }
{ "OpenMsResult" : { "id" : { "id" : "DHBHAJPMANJBFOAEDNFOJNMAGMDOKOGEAIHDMOJANENOLHHL!M!S!CMGOACMPMANJBFOAEJBMMEIECKBFBGGDEMJDDGLLEJCOMNOAM" }, "meta" : { "obInst" : { "obDesc" : { "@fullUrl" : "http:\/\/v-shp-development.dev.fs.fsight.world\/", "@isShortcut" : "0", "@isLink" : "0", "@ver" : "0", "@hf" : "0", "i" : "MODELSPACE", "n" : "Modeling container", "k" : "1581", "c" : "5121", "p" : "1580", "h" : "0", "hasPrv" : "0", "ic" : "0", "isPermanent" : "1", "isTemp" : "0" } }, "dirty" : "0", "items" : { "its" : { "it" : [ { "k" : "1627", "id" : "SCEN$TREE", "n" : "Scenario tree", "vis" : "1", "type" : "Folder" }, { "k" : "2564", "id" : "OBJ2564", "n" : "Model", "vis" : "1", "type" : "Problem" }, { "k" : "2803", "id" : "TEMP_MODEL", "n" : "TEMP_MODEL", "vis" : "1", "type" : "Problem" }, { "k" : "2846", "id" : "OBJ2846", "n" : "Model", "vis" : "1", "type" : "Problem" }, { "k" : "2889", "id" : "OBJ2889", "n" : "Model22", "vis" : "1", "type" : "Problem" }, { "k" : "2989", "id" : "OBJ2804_COPY1", "n" : "Model - Copy (1)", "vis" : "1", "type" : "MetaModel" }, { "k" : "2991", "id" : "TEMP_MODEL_COPY2", "n" : "TEMP_MODEL - Copy (2)", "vis" : "1", "type" : "Problem" }, { "k" : "2992", "id" : "OBJ2804_COPY2", "n" : "Model - Copy (2)", "vis" : "1", "type" : "MetaModel" }, { "k" : "3162", "id" : "OBJ3162", "n" : "temp", "vis" : "1", "type" : "Folder" }, { "k" : "3163", "id" : "OBJ3163", "n" : "Modeling variable3163", "vis" : "1", "type" : "Variable" }, { "k" : "3166", "id" : "OBJ3166", "n" : "Model3166", "vis" : "1", "type" : "Model" }, { "k" : "9092", "id" : "OBJ9092", "n" : "Model", "vis" : "1", "type" : "Model" }, { "k" : "3392", "id" : "LINEARR_MODEL", "n" : "LinearR", "vis" : "1", "type" : "Problem" }, { "k" : "3814", "id" : "MULTI_MODEL", "n" : "MultiModel", "vis" : "1", "type" : "Problem" }, { "k" : "4411", "id" : "MODEL_DEL", "n" : "model_del", "vis" : "1", "type" : "Problem" }, { "k" : "5190", "id" : "OBJ5190", "n" : "Model", "vis" : "1", "type" : "Problem" }, { "k" : "5247", "id" : "OBJ5247", "n" : "Model", "vis" : "1", "type" : "Problem" } ] } } }, "readOnly" : "0" } }
The OpenMs function opens a modeling container. The repository connection moniker and container identifier are passed as input parameters. The example uses the FindObjectById function, which code is given in the Getting Object Description by Its Identifier example. After executing the function returns the result of executing the OpenMs operation.
public static OpenMsResult OpenMs(MbId mb, string msId) { // Get modeling container key ulong msKey = FindObjectById(mb, msId).k; // Set operation execution parameters var tMsOp = new OpenMs(); tMsOp.tArg = new OpenMsArg() { args = new MsOpenArgs() }; tMsOp.tOb = new OdId(); // Form modeling container moniker tMsOp.tOb.id = mb.id + "!" + msKey.ToString(); // Create proxy object for operation execution var somClient = new SomPortTypeClient(); // Open modeling container OpenMsResult tResult = somClient.OpenMs(tMsOp); return tResult; }
See also: