GetDeclaration

Syntax

GetDeclarationResult GetDeclaration(OdId tObject, GetDeclarationArg tArg)

Parameters

tObject. Development environment object moniker.

tArg. Operation execution parameters.

Description

The GetDeclaration operation is used to work with code inspector.

Comments

The operation is used on working with units. The operation gets information about code inspector that contains the list of all members and types implemented on the unit/assembly. To execute the operation, in the tObject parameter specify moniker of the repository object that is unit or assembly. Object moniker can be obtained on executing the GetObjects operation.

Example

Below is the example of using the GetDeclaration operation to get information about members and types implemented in the unit. The request contains moniker of unit in the repository. The response contains information about members and types. The C# example uses the FindObjectById function, which code is given in the Getting Object Description by Its Identifier example.

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">
<GetDeclaration xmlns="http://www.fsight.ru/PP.SOM.Som">
<tObject xmlns="">
  <id>S1!M!172002</id>
  </tObject>
  <tArg xmlns="" />
  </GetDeclaration>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<GetDeclarationResult 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">
<result xmlns="">
<it>
  <type>Module</type>
  <name>Collections</name>
  <access>Private</access>
<beginPoint>
  <col>0</col>
  <row>0</row>
  </beginPoint>
<endPoint>
  <col>0</col>
  <row>0</row>
  </endPoint>
  </it>
<it>
  <type>Module</type>
  <name>Cubes</name>
  <access>Private</access>
<beginPoint>
  <col>0</col>
  <row>0</row>
  </beginPoint>
<endPoint>
  <col>0</col>
  <row>0</row>
  </endPoint>
  </it>
<it>
  <type>Module</type>
  <name>Metabase</name>
  <access>Private</access>
<beginPoint>
  <col>0</col>
  <row>0</row>
  </beginPoint>
<endPoint>
  <col>0</col>
  <row>0</row>
  </endPoint>
  </it>
<it>
  <type>Module</type>
  <name>System</name>
  <access>Private</access>
<beginPoint>
  <col>0</col>
  <row>0</row>
  </beginPoint>
<endPoint>
  <col>0</col>
  <row>0</row>
  </endPoint>
  </it>
<it>
  <type>Sub</type>
  <moduleName>M_ADDITIONAL</moduleName>
  <name>Main</name>
  <access>Private</access>
<beginPoint>
  <col>1</col>
  <row>23</row>
  </beginPoint>
<endPoint>
  <col>13</col>
  <row>30</row>
  </endPoint>
<blocks>
<it>
  <type>Var</type>
  <moduleName>M_ADDITIONAL</moduleName>
  <name>obj</name>
  <typeName>TestObject</typeName>
  <access>Private</access>
<beginPoint>
  <col>5</col>
  <row>25</row>
  </beginPoint>
<endPoint>
  <col>20</col>
  <row>25</row>
  </endPoint>
  <isShared>0</isShared>
  </it>
  </blocks>
  <isShared>0</isShared>
  </it>
<it>
  <type>Class</type>
  <moduleName>M_ADDITIONAL</moduleName>
  <name>TestObject</name>
  <access>Public</access>
<beginPoint>
  <col>8</col>
  <row>1</row>
  </beginPoint>
<endPoint>
  <col>21</col>
  <row>21</row>
  </endPoint>
<blocks>
<it>
  <type>Var</type>
  <moduleName>M_ADDITIONAL</moduleName>
  <name>_arr</name>
  <typeName>Array</typeName>
  <access>Private</access>
<beginPoint>
  <col>5</col>
  <row>2</row>
  </beginPoint>
<endPoint>
  <col>19</col>
  <row>2</row>
  </endPoint>
  <isShared>0</isShared>
  </it>
<it>
  <type>Sub</type>
  <moduleName>M_ADDITIONAL</moduleName>
  <name>Create</name>
  <access>Public</access>
<beginPoint>
  <col>12</col>
  <row>4</row>
  </beginPoint>
<endPoint>
  <col>27</col>
  <row>7</row>
  </endPoint>
  <blocks />
  <isShared>0</isShared>
  </it>
<it>
  <type>Sub</type>
  <moduleName>M_ADDITIONAL</moduleName>
  <name>CreateWithParams</name>
  <access>Public</access>
<beginPoint>
  <col>12</col>
  <row>9</row>
  </beginPoint>
<endPoint>
  <col>37</col>
  <row>15</row>
  </endPoint>
<blocks>
<it>
  <type>Var</type>
  <moduleName>M_ADDITIONAL</moduleName>
  <name>DefaultValue</name>
  <typeName>Double</typeName>
  <Value>0</Value>
  <access>Public</access>
<beginPoint>
  <col>56</col>
  <row>9</row>
  </beginPoint>
<endPoint>
  <col>80</col>
  <row>9</row>
  </endPoint>
  <isShared>0</isShared>
  </it>
<it>
  <type>Var</type>
  <moduleName>M_ADDITIONAL</moduleName>
  <name>Size</name>
  <typeName>Integer</typeName>
  <access>Public</access>
<beginPoint>
  <col>41</col>
  <row>9</row>
  </beginPoint>
<endPoint>
  <col>54</col>
  <row>9</row>
  </endPoint>
  <isShared>0</isShared>
  </it>
  </blocks>
  <isShared>0</isShared>
  </it>
<it>
  <type>Sub</type>
  <moduleName>M_ADDITIONAL</moduleName>
  <name>Run</name>
  <access>Public</access>
<beginPoint>
  <col>12</col>
  <row>17</row>
  </beginPoint>
<endPoint>
  <col>16</col>
  <row>20</row>
  </endPoint>
  <blocks />
  <isShared>0</isShared>
  </it>
  </blocks>
  </it>
  </result>
  </GetDeclarationResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"GetDeclaration" :
{
"tObject" :
{
"id" : "S1!M!172002"
},
"tArg" : ""
}
}

JSON response:

{
"GetDeclarationResult" :
{
"result" :
{
"it" :
[
{
"type" : "Module",
"name" : "Collections",
"access" : "Private",
"beginPoint" :
{
"col" : "0",
"row" : "0"
},
"endPoint" :
{
"col" : "0",
"row" : "0"
}
},
{
"type" : "Module",
"name" : "Cubes",
"access" : "Private",
"beginPoint" :
{
"col" : "0",
"row" : "0"
},
"endPoint" :
{
"col" : "0",
"row" : "0"
}
},
{
"type" : "Module",
"name" : "Metabase",
"access" : "Private",
"beginPoint" :
{
"col" : "0",
"row" : "0"
},
"endPoint" :
{
"col" : "0",
"row" : "0"
}
},
{
"type" : "Module",
"name" : "System",
"access" : "Private",
"beginPoint" :
{
"col" : "0",
"row" : "0"
},
"endPoint" :
{
"col" : "0",
"row" : "0"
}
},
{
"type" : "Sub",
"moduleName" : "M_ADDITIONAL",
"name" : "Main",
"access" : "Private",
"beginPoint" :
{
"col" : "1",
"row" : "23"
},
"endPoint" :
{
"col" : "13",
"row" : "30"
},
"blocks" :
{
"it" :
{
"type" : "Var",
"moduleName" : "M_ADDITIONAL",
"name" : "obj",
"typeName" : "TestObject",
"access" : "Private",
"beginPoint" :
{
"col" : "5",
"row" : "25"
},
"endPoint" :
{
"col" : "20",
"row" : "25"
},
"isShared" : "0"
}
},
"isShared" : "0"
},
{
"type" : "Class",
"moduleName" : "M_ADDITIONAL",
"name" : "TestObject",
"access" : "Public",
"beginPoint" :
{
"col" : "8",
"row" : "1"
},
"endPoint" :
{
"col" : "21",
"row" : "21"
},
"blocks" :
{
"it" :
[
{
"type" : "Var",
"moduleName" : "M_ADDITIONAL",
"name" : "_arr",
"typeName" : "Array",
"access" : "Private",
"beginPoint" :
{
"col" : "5",
"row" : "2"
},
"endPoint" :
{
"col" : "19",
"row" : "2"
},
"isShared" : "0"
},
{
"type" : "Sub",
"moduleName" : "M_ADDITIONAL",
"name" : "Create",
"access" : "Public",
"beginPoint" :
{
"col" : "12",
"row" : "4"
},
"endPoint" :
{
"col" : "27",
"row" : "7"
},
"blocks" : "",
"isShared" : "0"
},
{
"type" : "Sub",
"moduleName" : "M_ADDITIONAL",
"name" : "CreateWithParams",
"access" : "Public",
"beginPoint" :
{
"col" : "12",
"row" : "9"
},
"endPoint" :
{
"col" : "37",
"row" : "15"
},
"blocks" :
{
"it" :
[
{
"type" : "Var",
"moduleName" : "M_ADDITIONAL",
"name" : "DefaultValue",
"typeName" : "Double",
"Value" : "0",
"access" : "Public",
"beginPoint" :
{
"col" : "56",
"row" : "9"
},
"endPoint" :
{
"col" : "80",
"row" : "9"
},
"isShared" : "0"
},
{
"type" : "Var",
"moduleName" : "M_ADDITIONAL",
"name" : "Size",
"typeName" : "Integer",
"access" : "Public",
"beginPoint" :
{
"col" : "41",
"row" : "9"
},
"endPoint" :
{
"col" : "54",
"row" : "9"
},
"isShared" : "0"
}
]
},
"isShared" : "0"
},
{
"type" : "Sub",
"moduleName" : "M_ADDITIONAL",
"name" : "Run",
"access" : "Public",
"beginPoint" :
{
"col" : "12",
"row" : "17"
},
"endPoint" :
{
"col" : "16",
"row" : "20"
},
"blocks" : "",
"isShared" : "0"
}
]
}
}
]
}
}
}
public static GetDeclarationResult GetDeclaration(MbId mb, string objId)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var tGet = new GetDeclaration()
{
tArg = new GetDeclarationArg(),
//Create object moniker
tObject = new OdId() { id = mb.id + "!" + FindObjectById(mb, objId).k }
};
//Get information from code inspector
var result = somClient.GetDeclaration(tGet);
return result;
}

See also:

Working with Development Environment