Moving Elements

Below is the example of using the SetRdsElements operation to move MDM dictionary elements. The request contains key of the element to be moved, key of the element, relative to which the element is moved, and the position, to which the element is moved. The response contains key of the moved element.

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">
<SetRdsElements xmlns="http://www.fsight.ru/PP.SOM.Som">
<tRds xmlns="">
  <id>S1!M!S!N5</id>
  </tRds>
<tArg xmlns="">
  <op>Update</op>
<key>
  <key>4</key>
  </key>
<moveTo>
<element>
  <key>3</key>
  </element>
  <relation>FirstChild</relation>
  </moveTo>
  </tArg>
  </SetRdsElements>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<SetRdsElementsResult 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>S1!M!S!N5</id>
  </id>
<key xmlns="">
  <key>4</key>
  </key>
  </SetRdsElementsResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"SetRdsElements" :
{
"tRds" :
{
"id" : "S1!M!S!N5"
},
"tArg" :
{
"op" : "Update",
"key" :
{
"key" : "4"
},
"moveTo" :
{
"element" :
{
"key" : "3"
},
"relation" : "FirstChild"
}
}
}
}

JSON response:

{
"SetRdsElementsResult" :
{
"id" :
{
"id" : "S1!M!S!N5"
},
"key" :
{
"key" : "4"
}
}
}
public static SetRdsElementsResult MoveRdsElement(RdsId moniker, El[] elements)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var tSet = new SetRdsElements()
{
tArg = new SetRdsElementsArg()
{
op = RdsElementOperation.Update,
//Key of element to be moved
key = new ElKey()
{
key = elements[1].k
},
moveTo = new ElMoveInfo()
{
//Key of the element, relative to which move is executed
element = new ElKey() { key = elements[0].k },
relation = TreeRelation.FirstChild
}
},
tRds = moniker
};
//Move element
var tResult = somClient.SetRdsElements(tSet);
return tResult;
}

See also:

SetRdsElements