#Historical data support
One of the distinguishing features of the format is the support of historical data is the chronology of changes in public properties of a custom class — a business object. This allows you to get the value of a property at a specific point in time.
In order for a business object class to support working with historical data, it must implement the XyloCode.BusinessData.IBusinessObject
interface:
For example:
#Auto-commit changes
For the mode "serialization – deserialization – editing – serialization", automatic capture of changes when working with a business object is possible, it is activated by the HistoricalCapture
property of the binary serializer:
#Working with historical objects
Historical object (class XyloCode.BusinessData.HistoricalObject
) is a special tool for working with the historical data of a business object, it allows you to set, edit and get property values at a certain point in time.
The main methods used when working with historical objects:
Load()
— loading theBusinessObjectData
dictionary and storages of historical values;Refresh()
— actualization of theBusinessObjectData
dictionary in accordance with the data of the storages of historical values;Update()
— updating theBusinessObjectData
dictionary with the current values of the properties of an instance of the business object class;Get()
— getting the value of a property of a business object for a specific date and time;Set()
— setting the current value of the property of the business object;SetAfter()
— setting the historical value of the property of the business object, which should take effect from the specified date;SetBefore()
— setting the historical value of the property of the business object, which must be valid until the specified date;RemoveOnDate()
— removal of the historical value of the property of the business object, which is valid on the specified date;RemoveFromPastBefore()
— remove all historical values of the business object property that were in effect before the specified date and whose validity period has passed;RemoveFromPastAfter()
— remove all historical values of the business object property that have been in effect since the specified date and whose validity period has passed;RemoveFromFutureBefore()
— remove all historical values of the business object property that must be valid before the specified date and whose validity time has not yet arrived;RemoveFromFutureAfter()
— remove all historical values of the property of the business object, which should be valid from the specified date and whose validity time has not yet arrived;Save()
— saving changes to the storage of historical values.