Getting Elements History

Below is the example of using the GetRdsElements operation to get history of MDM dictionary elements. The request contains moniker of opened dictionary instance. The response contains information about elements history. Each history record contains the following data: element name at the corresponding period, values of all attributes, start date and end date of the period.

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">
<GetRdsElements xmlns="http://www.fsight.ru/PP.SOM.Som">
<tRds xmlns="">
  <id>S1!M!S!N3</id>
  </tRds>
<tArg xmlns="">
<parent>
  <key />
  </parent>
<filter>
  <levels>-1</levels>
  <includeRoot>false</includeRoot>
  <onlySelected>false</onlySelected>
  <includeParents>true</includeParents>
  <includeParentsWithSiblings>true</includeParentsWithSiblings>
  </filter>
<pattern>
  <attributes>*</attributes>
  <attributeValuesOnly>false</attributeValuesOnly>
  <extendedAttributeValuesOnly>true</extendedAttributeValuesOnly>
  <getSelectState>true</getSelectState>
  <getParentKey>true</getParentKey>
  <getHasChildren>true</getHasChildren>
  <getLevel>true</getLevel>
  <getHasSelectedChildren>true</getHasSelectedChildren>
  <getHistory>true</getHistory>
  <getImageIndex>true</getImageIndex>
  </pattern>
  </tArg>
  </GetRdsElements>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<GetRdsElementsResult 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 hc="0" l="1">
  <n>Fact 1</n>
<ea>
  <it v="2" />
  <it v="Fact 1" />
  <it />
  <it v="64" />
  <it v="2" />
  <it v="2020-01-01" />
  <it v="2020-02-01" />
  </ea>
  <k>2</k>
  <h>0</h>
  <o>0</o>
  <p>4294967294</p>
<hist>
<it>
  <n>Fact 1</n>
<ea>
  <it v="2" />
  <it v="Fact 1" />
  <it />
  <it v="64" />
  <it v="2" />
  <it v="2020-01-01" />
  <it v="2020-02-01" />
  </ea>
  <inDate>2020-01-01</inDate>
  <outDate>2020-02-01</outDate>
  </it>
<it>
  <n>Fact</n>
<ea>
  <it v="2" />
  <it v="Fact" />
  <it />
  <it v="64" />
  <it v="3" />
  <it v="2020-02-01" />
  <it v="2020-03-01" />
  </ea>
  <inDate>2020-02-01</inDate>
  <outDate>2020-03-01</outDate>
  </it>
<it>
  <n>Data</n>
<ea>
  <it v="2" />
  <it v="Data" />
  <it />
  <it v="64" />
  <it v="4" />
  <it v="2020-03-01" />
  <it v="2999-12-31" />
  </ea>
  <inDate>2020-03-01</inDate>
  <outDate>2999-12-31</outDate>
  </it>
  </hist>
  </e>
  </els>
<id xmlns="">
  <id>S1!M!S!N3</id>
  </id>
  </GetRdsElementsResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"GetRdsElements" :
{
"tRds" :
{
"id" : "S1!M!S!N3"
},
"tArg" :
{
"parent" :
{
"key" : ""
},
"filter" :
{
"levels" : "-1",
"includeRoot" : "false",
"onlySelected" : "false",
"includeParents" : "true",
"includeParentsWithSiblings" : "true"
},
"pattern" :
{
"attributes" : "*",
"attributeValuesOnly" : "false",
"extendedAttributeValuesOnly" : "true",
"getSelectState" : "true",
"getParentKey" : "true",
"getHasChildren" : "true",
"getLevel" : "true",
"getHasSelectedChildren" : "true",
"getHistory" : "true",
"getImageIndex" : "true"
}
}
}
}

JSON response:

{
"GetRdsElementsResult" :
{
"els" :
{
"e" :
{
"@hc" : "0",
"@l" : "1",
"n" : "Fact 1",
"ea" :
{
"it" :
[
{
"@v" : "2"
},
{
"@v" : "Fact 1"
},
"",
{
"@v" : "64"
},
{
"@v" : "2"
},
{
"@v" : "2020-01-01"
},
{
"@v" : "2020-02-01"
}
]
},
"k" : "2",
"h" : "0",
"o" : "0",
"p" : "4294967294",
"hist" :
{
"it" :
[
{
"n" : "Fact 1",
"ea" :
{
"it" :
[
{
"@v" : "2"
},
{
"@v" : "Fact 1"
},
"",
{
"@v" : "64"
},
{
"@v" : "2"
},
{
"@v" : "2020-01-01"
},
{
"@v" : "2020-02-01"
}
]
},
"inDate" : "2020-01-01",
"outDate" : "2020-02-01"
},
{
"n" : "Fact",
"ea" :
{
"it" :
[
{
"@v" : "2"
},
{
"@v" : "Fact"
},
"",
{
"@v" : "64"
},
{
"@v" : "3"
},
{
"@v" : "2020-02-01"
},
{
"@v" : "2020-03-01"
}
]
},
"inDate" : "2020-02-01",
"outDate" : "2020-03-01"
},
{
"n" : "Data",
"ea" :
{
"it" :
[
{
"@v" : "2"
},
{
"@v" : "Data"
},
"",
{
"@v" : "64"
},
{
"@v" : "4"
},
{
"@v" : "2020-03-01"
},
{
"@v" : "2999-12-31"
}
]
},
"inDate" : "2020-03-01",
"outDate" : "2999-12-31"
}
]
}
}
},
"id" :
{
"id" : "S1!M!S!N3"
}
}
}
public static GetRdsElementsResult GetHistoryElements(RdsId moniker)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
//Operation execution parameters
var tGet = new GetRdsElements()
{
tArg = new GetRdsElementsArg()
{
parent = new ElKey
{
key = string.Empty
},
filter = new ElsFilter
{
includeRoot = false,
includeParents = true,
includeParentsWithSiblings = true,
onlySelected = false,
levels = -1
},
pattern = new ElsPattern // Pattern for getting data
{
getParentKey = true,
getHasChildren = true,
getHasSelectedChildren = true,
getLevel = true,
getSelectState = true,
getHistory = true,
attributes = "*",
attributeValuesOnly = false,
extendedAttributeValuesOnly = true
},
},
tRds = moniker
};
// Get elements changing history
var tResult = somClient.GetRdsElements(tGet);
return tResult;
}

See also:

GetRdsElements