GetDeclarationBlock

Syntax

GetDeclarationResult GetDeclarationBlock(OdId tObject, GetDeclarationBlockArg tArg)

Parameters

tObject. Unit or assembly moniker.

tArg. Operation execution parameters.

Description

The GetDeclarationBlock operation is used to navigate through code.

Comments

The operation gets information about global members or types implemented in the code, and also about local members implemented inside namespaces, classes and interfaces. To execute the operation, in the tObject parameter specify moniker of the repository object that is unit or assembly. The object moniker can be obtained on executing the GetObjects operation. In the tArg.path parameter specify name of the type, for which one should get information about local members. If tArg.path is not set, information about global members and types is obtained.

Example

Below is the example of using the GetDeclarationBlock operation to get information about members of the specified class. The request contains moniker of unit in the repository and class name. The response contains information about class members. 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">
<GetDeclarationBlock xmlns="http://www.fsight.ru/PP.SOM.Som">
<tObject xmlns="">
  <id>S1!M!172002</id>
  </tObject>
<tArg xmlns="">
  <path>TestObject</path>
  </tArg>
  </GetDeclarationBlock>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<GetDeclarationBlockResult 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>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>
  <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>
  <name>DefaultValue</name>
  <typeName>Double</typeName>
  <access>Public</access>
<beginPoint>
  <col>12</col>
  <row>9</row>
  </beginPoint>
<endPoint>
  <col>37</col>
  <row>15</row>
  </endPoint>
  </it>
<it>
  <type>Var</type>
  <name>Size</name>
  <typeName>Integer</typeName>
  <access>Public</access>
<beginPoint>
  <col>12</col>
  <row>9</row>
  </beginPoint>
<endPoint>
  <col>37</col>
  <row>15</row>
  </endPoint>
  </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>
  <isShared>0</isShared>
  </it>
  </result>
  </GetDeclarationBlockResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"GetDeclarationBlock" :
{
"tObject" :
{
"id" : "S1!M!172002"
},
"tArg" :
{
"path" : "TestObject"
}
}
}

JSON response:

{
"GetDeclarationBlockResult" :
{
"result" :
{
"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"
},
"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",
"name" : "DefaultValue",
"typeName" : "Double",
"access" : "Public",
"beginPoint" :
{
"col" : "12",
"row" : "9"
},
"endPoint" :
{
"col" : "37",
"row" : "15"
}
},
{
"type" : "Var",
"name" : "Size",
"typeName" : "Integer",
"access" : "Public",
"beginPoint" :
{
"col" : "12",
"row" : "9"
},
"endPoint" :
{
"col" : "37",
"row" : "15"
}
}
]
},
"isShared" : "0"
},
{
"type" : "Sub",
"moduleName" : "M_ADDITIONAL",
"name" : "Run",
"access" : "Public",
"beginPoint" :
{
"col" : "12",
"row" : "17"
},
"endPoint" :
{
"col" : "16",
"row" : "20"
},
"isShared" : "0"
}
]
}
}
}
public static GetDeclarationResult GetDeclarationBlock(MbId mb, string objId)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var tGet = new GetDeclarationBlock()
{
tArg = new GetDeclarationBlockArg()
{
path = "TestObject"
},
//Create object moniker
tObject = new OdId() { id = mb.id + "!" + FindObjectById(mb, objId).k }
};
//Get information about class child members
var result = somClient.GetDeclarationBlock(tGet);
return result;
}

See also:

Working with Development Environment