tagHistory in SDK module

Hello,
I am developing a script to make a query in the database from the SDK module, in designer script I use system.tag.queryTagHistory to get the dataset, but I can't find the function to get the dataset from java, would there be any way to make that query? thank you

From the GatewayContext delivered to your module's setup, you get the GatewayTagHistoryManager. From there, issue a tag history query you constructed, and collect the results in a BasicStreamingDataset, which implements the Dataset interface.

1 Like

I understand, while building it I have another problem, for the BasicStreamingDataset I need a StreamingDatasetWriter and I have an error to initialize it in the columType parameter.

public class BasicStreamingDataset extends AbstractDataset implements StreamingDatasetWriter

You don't need an additional class. Construct a BasicStreamingDataset and pass it directly to queryHistory.

Ok, to build the BasicStreamingDataset I need two lists, one of names and the other of types, the list of types is the one that is giving me error

No, you don't? It has a no-arg constructor.

https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.24/com/inductiveautomation/ignition/gateway/datasource/BasicStreamingDataset.html#constructor.summary

I was able to perform the query, thank you very much
tagHistoryManager.queryHistory(params,dataStream);
What option could you recommend me to validate the data I am getting in dataStream?