Selecting Elements Corresponding to Group of Elements

Below is the example of using the GetDimElements operation to select elements using a group of dictionary elements. The request contains moniker of opened dictionary instance and the element group identifier. Identifiers and names will be loaded for selected elements.

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">
<GetDimElements xmlns="http://www.fsight.ru/PP.SOM.Som">
<tDim xmlns="">
  <id>S1!M!S!S1</id>
  </tDim>
<tArg xmlns="">
<filter>
  <includeParents>false</includeParents>
  <includeParentsWithSiblings>false</includeParentsWithSiblings>
<group>
  <k>18446744073709551615</k>
  <id>GROUP1</id>
  </group>
  </filter>
<pattern>
  <attributes>ID;NAME</attributes>
  <getImageIndex>true</getImageIndex>
  </pattern>
  </tArg>
  </GetDimElements>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<GetDimElementsResult 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">
<els xmlns="">
<e>
  <n>Item 1</n>
<a>
  <it>1</it>
  <it>First element</it>
  </a>
<ea>
  <it v="1" />
  <it v="First element" />
  </ea>
  <k>1</k>
  <h>0</h>
  <o>0</o>
  </e>
<e>
  <n>Item 2</n>
<a>
  <it>2</it>
  <it>Second element</it>
  </a>
<ea>
  <it v="2" />
  <it v="Second element" />
  </ea>
  <k>2</k>
  <h>0</h>
  <o>1</o>
  </e>
<e>
  <n>Item 3</n>
<a>
  <it>3</it>
  <it>Third element</it>
  </a>
<ea>
  <it v="3" />
  <it v="Third element" />
  </ea>
  <k>3</k>
  <h>0</h>
  <o>2</o>
  </e>
<e>
  <n>Item 4</n>
<a>
  <it>4</it>
  <it>Fourth element</it>
  </a>
<ea>
  <it v="4" />
  <it v="Fourth element" />
  </ea>
  <k>4</k>
  <h>0</h>
  <o>0</o>
  </e>
<e>
  <n>Fifth element</n>
<a>
  <it>5</it>
  <it>Fifth element</it>
  </a>
<ea>
  <it v="5" />
  <it v="Fifth element" />
  </ea>
  <k>5</k>
  <h>0</h>
  <o>0</o>
  </e>
  </els>
<id xmlns="">
  <id>S1!M!S!S1</id>
  </id>
  </GetDimElementsResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"GetDimElements" :
{
"tDim" :
{
"id" : "S1!M!S!S1"
},
"tArg" :
{
"filter" :
{
"includeParents" : "false",
"includeParentsWithSiblings" : "false",
"group" :
{
"k" : "18446744073709551615",
"id" : "GROUP1"
}
},
"pattern" :
{
"attributes" : "ID;NAME",
"getImageIndex" : "true"
}
}
}
}

JSON response:

{
"GetDimElementsResult" :
{
"els" :
{
"e" :
[
{
"n" : "First element",
"a" :
{
"it" :
[
"1",
"First element"
]
},
"ea" :
{
"it" :
[
{
"@v" : "1"
},
{
"@v" : "First element"
}
]
},
"k" : "1",
"h" : "0",
"o" : "0"
},
{
"n" : "Second element",
"a" :
{
"it" :
[
"2",
"Second element"
]
},
"ea" :
{
"it" :
[
{
"@v" : "2"
},
{
"@v" : "Second element"
}
]
},
"k" : "2",
"h" : "0",
"o" : "1"
},
{
"n" : "Third element",
"a" :
{
"it" :
[
"3",
"Third element"
]
},
"ea" :
{
"it" :
[
{
"@v" : "3"
},
{
"@v" : "Third element"
}
]
},
"k" : "3",
"h" : "0",
"o" : "2"
},
{
"n" : "Fourth element",
"a" :
{
"it" :
[
"4",
"Fourth element"
]
},
"ea" :
{
"it" :
[
{
"@v" : "4"
},
{
"@v" : "Fourth element"
}
]
},
"k" : "4",
"h" : "0",
"o" : "0"
},
{
"n" : "Fifth element",
"a" :
{
"it" :
[
"5",
"Fifth element"
]
},
"ea" :
{
"it" :
[
{
"@v" : "5"
},
{
"@v" : "Fifth element"
}
]
},
"k" : "5",
"h" : "0",
"o" : "0"
}
]
},
"id" :
{
"id" : "S1!M!S!S1"
}
}
}
public static GetDimElementsResult GetGroupElements(DmId moniker, string groupId)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var tElements = new GetDimElements()
{
tArg = new GetDimElementsArg()
{
pattern = new ElsPattern()
{
attributes = "ID;NAME"
},
//Element filtering parameters
filter = new ElsFilter()
{
group = new ItKey() { id = groupId, k = uint.MaxValue }
}
},
tDim = moniker
};
//Get information about dictionary elements
var result = somClient.GetDimElements(tElements);
return result;
}

See also:

GetDimElements