Store tag history from a module

Hello,

I'm currently working in version 8.3 and looking for a way to push historical tag values.

Here’s what I’ve found so far:
The history management system has been redesigned and moved into a separate module called "historian", and as a result, the HistoryManager has been removed.

Currently, in version 8.1, I access storeHistory from the HistoryManager in order to push tag history values:
gatewayContext.getHistoryManager().storeHistory(...)

According to the documentation for system.tag.storeTagHistory, it now seems that we should use system.historian.storeDataPoints instead.

system.historian.storeDataPoints relies on the storeAtomicPoints function from HistorianManagerImpl.

It's possible to retrieve the instance of HistorianManagerImpl using the getHistorianManager method from HistorianGatewayHook.

Is there a cleaner and more straightforward way to push historical tag values (ideally without relying on reflection or accessing the ScriptManager)?

As you noted, storing Historian data has been moved into the Historian module rather than coupled with the Store & Forward system (old HistoryManager, now called StoreAndForwardManager) for storage.

The most correct method would be to grab the Historian's StorageEngine using HistorianManager.get(gatewayContext).getStorageEngine(historianName), and then to store AtomicPoints through StorageEngine::storeAtomic. Creating atomic points can be done using DataPointFactory::createAtomicPoint.

You shouldn't need to use Reflection. New Historian SDK dependencies will be available on 7/29 that will expose historian-gateway and historian-common. Currently only historian-gateway is exposed through the historian artifact (which is now renamed to match).

4 Likes