CopyRdsElements

Syntax

CopyRdsElementsResult CopyRdsElements(RdsId tRds, CopyRdsElementsArg tArg)

Parameters

tRds. Moniker of opened composite MDM dictionary instance.

tArg. Operation execution parameters.

Description

The CopyRdsElements operation copies elements from data source to composite MDM dictionary.

Comments

To execute the operation, in the tRds field specify moniker of opened composite MD dictionary instance, and in the tArg.tRdsSource field specify moniker of opened data source instance, and in the tArg.keys fiels specify keys of copied elements. Monikers can be obtained on executing the OpenRds operation. Dictionaries should be opened for working with data (openForEdit = false). If the tArg.moveTo field is defined, elements will be copied as child ones for the specified element.

The operation results in new keys of the copied elements.

Example

Below is the example of copying elements from data source to composite MDM dictionary. The request contains monikers of composite MDM dictionary, dictionary's data source, and keys of copied elements. The request also contains key of the element, for which the copied elements will be used as child ones. The response contains new keys of the copied 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">
<CopyRdsElements xmlns="http://www.fsight.ru/PP.SOM.Som">
<tRds xmlns="">
  <id>LFDCEOAJELGFGOAEOHNCJJKKEAEKGGDECKEPMBLACNIPJPNG!M!S!NPIFBCHBJELGFGOAECMLPAPIKJFNEPKKEGJGBPHNCKPGLFGNM</id>
  </tRds>
<tArg xmlns="">
<tRdsSource>
  <id>LFDCEOAJELGFGOAEOHNCJJKKEAEKGGDECKEPMBLACNIPJPNG!M!S!NPMCHHHBJELGFGOAEFPBDBBDHMOMJJLAEBKGELOEPLFAHKBDO</id>
  </tRdsSource>
<keys>
<its>
<it>
  <key>1</key>
  </it>
<it>
  <key>2</key>
  </it>
  </its>
  </keys>
<moveTo>
<element>
  <key>2</key>
  </element>
  <relation>LastChild</relation>
  </moveTo>
  </tArg>
  </CopyRdsElements>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<CopyRdsElementsResult 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>LFDCEOAJELGFGOAEOHNCJJKKEAEKGGDECKEPMBLACNIPJPNG!M!S!NPIFBCHBJELGFGOAECMLPAPIKJFNEPKKEGJGBPHNCKPGLFGNM</id>
  </id>
<keys xmlns="">
<its>
<it>
  <key>6</key>
  </it>
<it>
  <key>7</key>
  </it>
  </its>
  </keys>
  </CopyRdsElementsResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"CopyRdsElements" :
{
"tRds" :
{
"id" : "LFDCEOAJELGFGOAEOHNCJJKKEAEKGGDECKEPMBLACNIPJPNG!M!S!NPIFBCHBJELGFGOAECMLPAPIKJFNEPKKEGJGBPHNCKPGLFGNM"
},
"tArg" :
{
"tRdsSource" :
{
"id" : "LFDCEOAJELGFGOAEOHNCJJKKEAEKGGDECKEPMBLACNIPJPNG!M!S!NPMCHHHBJELGFGOAEFPBDBBDHMOMJJLAEBKGELOEPLFAHKBDO"
},
"keys" :
{
"its" :
{
"it" :
[
{
"key" : "1"
},
{
"key" : "2"
}
]
}
},
"moveTo" :
{
"element" :
{
"key" : "2"
},
"relation" : "LastChild"
}
}
}
}

JSON response:

{
"CopyRdsElementsResult" :
{
"id" :
{
"id" : "LFDCEOAJELGFGOAEOHNCJJKKEAEKGGDECKEPMBLACNIPJPNG!M!S!NPIFBCHBJELGFGOAECMLPAPIKJFNEPKKEGJGBPHNCKPGLFGNM"
},
"keys" :
{
"its" :
{
"it" :
[
{
"key" : "6"
},
{
"key" : "7"
}
]
}
}
}
}
public static CopyRdsElementsResult CopyRdsElements(string compDictMoniker, string sourceMoniker, RdsKeys copyElementsKeys, string copyToElement)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tCopy = new CopyRdsElements()
{
tArg = new CopyRdsElementsArg()
{
keys = copyElementsKeys,
moveTo = (copyToElement != null ? new ElMoveInfo() { element = new ElKey() { key = copyToElement }, relation = TreeRelation.LastChild } : null),
tRdsSource = new RdsId() { id = sourceMoniker }
},
tRds = new RdsId() { id = compDictMoniker }
};
// Copy elements from data source to composite MDM dictionary
var tResult = somClient.CopyRdsElements(tCopy);
return tResult;
}

See also:

Working with MDM Dictionaries