Posted: 2020-08-3110:39 AM. Last Modified: 2020-08-3110:40 AM
Re: SmartConnector AlarmItem question - how to
I recommend using the SmartConnector.Utilities library, which you can get from the same NuGet library as the rest of the Smart Connector NuGet packages.
Inside of this library there is a class called EwsItemManager, this class helps abstract many common uses of the main EwsServerDataAdapter class to make it easier to create and modify objects in your EWS Server.
Within this class there are a few functions that can be used together to help you manage alarm items and alarm events for your EWS Server in Smart Connector:
EnsureAlarmItem: This method allows you to create an AlarmItem in your database, or modify an exist one's property's (not the alarm events themselves). This method checks if the item exists before it creates one, and will modify the existing if it already exists.
EnsureAlarmEventTyps: This method allows you to create an Alarm Event Type (e.g. Category that will be attached to your alarms, and displayed in the EWS client; EBO for example).
CreateAlarmEvent: This method allows you to create an AlarmEvent from one of your AlarmItems, it also allows for a custom message field.
There are also a lot of helpful methods in this class for dealing with other object types in the EWS server such as Containers, Values, and Trends as well.