Skip to main content

ReadHistoryModified

If the server allows HistoryUpdate(edit history), the data may have been modified. ReadHistoryModified Retrieve all versions and revision history for auditing and regulatory compliance purposes.

Preliminary / Supporting

Signature​

std::vector<DataValue> ReadHistoryModified(
std::string const& node_id,
int64_t start_ft,
int64_t end_ft,
uint32_t max_values = 0,
bool return_bounds = false);
ParametersDefaultNote
node_id—Objective NodeId
start_ft—Range starts at (FileTime)
end_ft—Range Stop (FileTime)
max_values0 (No limit)Maximum number of results per query
return_boundsfalsetrue = Returns a set containing the boundary points

Returns std::vector<DataValue>. The ModificationInfo contained within the server is not currently exposed; only its DataValue own values, state, and timestamp are exposed.

Usage​

auto modified = s.ReadHistoryModified("ns=2;s=Temperature",
yesterday_ft, today_ft);

for (auto const& m : modified) {
std::cout << "ft=" << m.SourceTimestamp()
<< " val=" << m.Value().AsString()
<< " status=0x" << std::hex << m.StatusCode() << "\n";
}

When to Use​

  • Regulatory Compliance: Regulated industries (pharmaceuticals, food, etc.) require "data traceability"
  • Audit Log: Who Changed the Key Parameters?
  • Data Recovery Rollback: Know what the value was before the change

Server Requirements​

  • Must be implemented HistoryUpdate
  • The revision history must be preserved (rather than overwritten).
  • The user identity must be passed correctly (the C++ side currently supports only Anonymous and Username tokens; Certificate and Issued tokens have not yet been implemented).

Next Step​