How can we reload KnownEventTypes without restarting Event Server?

We’ve implemented GetKnownEventTypes with the following code, which creates an event type for each “Group” we have defined in our system:

public override System.Collections.ObjectModel.Collection<VideoOS.Platform.Data.EventType> GetKnownEventTypes(System.Globalization.CultureInfo culture)
        {
            eventTypes.Clear();
            List<Tuple<string, Guid>> groupEventDefinitons = IdentityDisplayer.GetGroupEventDefinitions();
            foreach (var entry in groupEventDefinitons)
            {
                eventTypes.Add(
                new EventType()
                {
                    GroupID = RocWatchPluginDefinition.EventGroupId,
                    ID = entry.Item2,
                    DefaultSourceKind = RocWatchPluginDefinition.RocWatchPluginKind,
                    Message = entry.Item1,
                    SourceKinds = new List<Guid>() { Kind.Camera }
                });
            }
 
            return eventTypes;
        }

The above code works correctly when viewed in the Management Client as we see the expected event types when creating Rule triggers. However, when we remove an entry from the returned eventTypes collection, the event type corresponding to that entry is not removed in the Management Client when creating Rule triggers. Additionally, if we add an entry to the eventTypes collection, the corresponding event type is not added to Rule triggers in the Management Client.

Essentially, after the first time GetKnownEventTypes is called, we cannot update the available Rule triggers in the Management Client until we restart the Event Server. Is there a way to update the available Rule trigger events in the Management Client without restarting the Event Server?

Hi Jason,

The problem you’re running into is that the event server only asks for available events once, when it is started. There is currently no way to update the available events without restarting the event server.

Simon,

Understood. We’ve taken the approach of programmatically adding and removing analytics events instead with AnalyticsEventFolder.AddAnalyticsEvent() and AnalyticsEventFolder.RemoveAnalyticsEvent(). As a follow up, is there a way to prevent the user of the Management Client from manually deleting these analytics events we create?

For some background on the question: We allow the user to create instances of a “Group” in our integration. When someone from that Group is encountered we send an analytics event specific to that Group to the Event Server so that the Rule System can respond accordingly. Therefore, when a user creates a new Group, we’d like for the corresponding analytics event we create to not be delete-able by the user.

A user that has the rights to open the Management Client and manage the system will be able to remove analytics events same way as he can remove cameras.

Note that XProtect Corporate is special as you can utilize differentiated admin rights. Using this functionality you can e.g. create a user role that can manage cameras but not analytics events. However this then works in the way that the user can either manage and delete all analytics events or the user cannot manage or delete any analytics events. You cannot have the events you create marked as special and not manageable for the user, the functionality does not allow distinguishing one analytics event from another.

See also - https://doc.milestonesys.com/2020R1/en-US/standard_features/sf_mc/sf_mcnodes/sf_6security/mc_security.htm?cshid=9893#MC_RolesExplained.htm

Ok, I will keep that in mind. Thank you for the fast responses.