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.
{
"SetRdsElements" :
{
"tRds" :
{
"id" : "S1!M!S!N5"
},
"tArg" :
{
"op" : "Update",
"key" :
{
"key" : "4"
},
"moveTo" :
{
"element" :
{
"key" : "3"
},
"relation" : "FirstChild"
}
}
}
}
{
"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: