Opening Modeling Container and Getting Scenario Data

Below is the example of using the OpenMs operation to open a modeling container. The request contains the container moniker and a pattern for getting data. The response contains the opened modeling container instance moniker and data about the container scenarios.

The C# example uses the FindObjectById function, which code is given in the Getting Object Description by Its Identifier section.

 

SOAP request:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<OpenMs xmlns="http://www.fsight.ru/PP.SOM.Som">
<tOb xmlns="">
  <id>GEGBFKLHGPMOFOAEIMFEBNKILLAKNJBEIKKFGPFLECLAJIMA!M!306480</id>
  </tOb>
<tArg xmlns="">
  <args />
<metaGet>
  <obInst>false</obInst>
  <all>false</all>
  <scenarios>Get</scenarios>
  <period>false</period>
  </metaGet>
  </tArg>
  </OpenMs>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<OpenMsResult xmlns="http://www.fsight.ru/PP.SOM.Som" xmlns:q1="http://www.fsight.ru/PP.SOM.Som" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<id xmlns="">
  <id>GEGBFKLHGPMOFOAEIMFEBNKILLAKNJBEIKKFGPFLECLAJIMA!M!S!CKHMBBEMHGPMOFOAEFJLGEGOGHKBCBLNEIJJACPIMKMHIKJIC</id>
  </id>
<meta xmlns="">
<scenarios>
<nodes>
<it isFolder="0">
  <k>306497</k>
  <id>OBJ306497</id>
  <n>Base</n>
  <vis>1</vis>
<scenDesc ds="" isShortcut="0" isLink="0" ver="2" hf="0">
  <i>OBJ306497</i>
  <n>Base</n>
  <k>306497</k>
  <c>5124</c>
  <p>306485</p>
  <h>0</h>
  <hasPrv>0</hasPrv>
  <ic>0</ic>
  <trackElementDependents>0</trackElementDependents>
  </scenDesc>
  <internalKey>306497</internalKey>
  </it>
  </nodes>
  </scenarios>
  </meta>
  <readOnly xmlns="">0</readOnly>
  </OpenMsResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"OpenMs" :
{
"tOb" :
{
"id" : "GEGBFKLHGPMOFOAEIMFEBNKILLAKNJBEIKKFGPFLECLAJIMA!M!306480"
},
"tArg" :
{
"args" : "",
"metaGet" :
{
"obInst" : "false",
"all" : "false",
"scenarios" : "Get",
"period" : "false"
}
}
}
}

JSON response:

{
"OpenMsResult" :
{
"id" :
{
"id" : "GEGBFKLHGPMOFOAEIMFEBNKILLAKNJBEIKKFGPFLECLAJIMA!M!S!CKHMBBEMHGPMOFOAEFJLGEGOGHKBCBLNEIJJACPIMKMHIKJIC"
},
"meta" :
{
"scenarios" :
{
"nodes" :
{
"it" :
{
"@isFolder" : "0",
"k" : "306497",
"id" : "OBJ306497",
"n" : "Basic",
"vis" : "1",
"scenDesc" :
{
"@ds" : "",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "2",
"@hf" : "0",
"i" : "OBJ306497",
"n" : "Basic",
"k" : "306497",
"c" : "5124",
"p" : "306485",
"h" : "0",
"hasPrv" : "0",
"ic" : "0",
"trackElementDependents" : "0"
},
"internalKey" : "306497"
}
}
}
},
"readOnly" : "0"
}
}
public static MsScenarioTree OpenMsMeta(MbId mb, string msId)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
// Set operation execution parameters
var tMsOp = new OpenMs()
{
tArg = new OpenMsArg()
{
// Set container opening parameters
args = new MsOpenArgs(),
// Set data getting pattern
metaGet = new MsMdPattern()
{
all = false,
obInst = false,
period = false,
scenarios = ListOperation.Get
}
},
// Create modeling container moniker
tOb = new OdId() { id = mb.id + "!" + FindObjectById(mb, msId).k }
};
// Open modeling container with metadata request
var result = somClient.OpenMs(tMsOp);
return result.meta.scenarios;
}

See also:

OpenMs: Operation