Creating a generic ACEventType for multiple Access control events

We have a scenario where we must pass on hundreds of access control events from our Access control application to Velocity Vision through the plugin. For example, we create individual events like below:

public static ACEventType ForcedEntry = new ACEventType(“5001”, “Forced Entry”, ACBuiltInIconKeys.Door, null, new[] { Categories.ForcedEntryEvent.Id }) {IsEnabled = true} ;

   public static ACEventType AlarmAtInput = new ACEventType("5002", "Alarm at Input", ACBuiltInIconKeys.Door, null, new\[\] { [Categories.AlarmatInput.Id](https://Categories.AlarmatInput.Id) }) { IsEnabled = true };

   public static ACEventType DOTLatInput = new ACEventType("5003", "DOTL At Input", ACBuiltInIconKeys.Door, null, new\[\] { [Categories.DOTLatInput.Id](https://Categories.DOTLatInput.Id) }) { IsEnabled = true };

Instead for declaring individual events, I would like to create a generic event like “Integrated Event” and append the actual message of the event during runtime. Since we have 1000s of access control events and don’t want to modify the plugin code for including each new event I would like to know if there are any alternative way to create this.

I was able to create a common category for multiple ACEventTyper but couldn’t find a way to create a generic ACEventType.

The fifth parameter in the ACEvent constructor is a message that can be any string.

In the demo plugin we input the name of the type for that event, but that is not strictly necessary. You can put different information.

If you create a “Generic Door Event” type, you can give all events coming from doors that type and then set the message text to be something more specific.

For example:

//When constructing the AC System configuration
var GernericDoorType = new ACEventType("5001", "Door event", ACBuiltInIconKeys.Door, null, new[] {Categories.DoorCategory.Id}) {IsEnabled = true};
.......
//When an event from a door is triggered
private void FireDoorEvent(string eventMessage)
{
   var event = new ACEvent(Guid.NewGuid().ToString(), GenericDoorType.Id, _client.ServerId, DateTime.UtcNow, eventMessage, string.Empty, null, null, null);
   FireEventsOccurred(new[] { event });
}

However, I would strongly suggest not doing it this way. This makes the ability for the user to create rules and alarms based on access control events very limited, because they are based on event types and event type categories and you are flattening all possible event types to a single one.

Maybe a better way to save on manual creation of those event type objects would be to get the information for possible event types directly from the access control system (or a configuration file) in some way and creating the appropriate objects in the plugin at runtime.