Version 8.3.1 Gateway event script not able to see DataPointFactory

The code is developed in the design script console and run without issue. Tried to run the same script in the gateway scheduled event and error complains about the historian module issue. Any idea?

In the Gateway scope, scripting can't access APIs provided by modules because modules are loaded in their own ClassLoader at a different location in the ClassLoader hierarchy.

It only happens to work in Designer / Vision Client because everything is loaded into a single ClassLoader up there.

Thank you for identifying the issue. What needs to be adjusted to allow the script to run in the Gateway scope

just use this on any scope

system.historian.storeDataPoints(paths = ["histprov:mariadb:/sys:gatewayName1:/prov:default:/tag:test_a"], values = [1], qualities = [192], timestamps = [system.date.now()])

Stick to scripting functions that are available in system.*.

Otherwise, you may simply not be able to do whatever it is you're trying to do from a script. It might be something that needs to be done from a custom module that depends on the historian module.

The code is borrow from the 8.3 Manual using the Syntax #1 method. Thank for the direction

Unfortunate. I'll ping the docs and/or history team and let them know.

They may end up having to export certain classes provided by the historian module under the system.historian namespace.

Updated the script to use the Syntax #2 which is the method you recommended. Problem is resolved. Thank you