Add alarm definition via plugin

Hello,

In Corporate 2026 R1, I can no longer create a complete alarm definition using my plugin. The sample (ConfigAPIClient) doesn’t work properly here either. It failed when I select Analytics events.

My plugin does create the alarm definition, but the entries for alarm trigger/type, related maps, etc., are missing.

Has something changed? I couldn’t find anything about this in the release letters.

Many thanks in advance.

I’ve been able to reproduce some unexpected / erroneous behavior here, and it looks like a bug on our side.

To make sure we’re looking at the exact same scenario, could you please share the exact code snippet where you create and execute the AddAlarmDefinition server task?

If you’re not using AddAlarmDefinitionServerTask but another mechanism, then please paste that call instead.

That should give us the missing detail we need to verify the inputs and confirm the bug path.

Hello Bo,

here are the code snippets:

AlarmDefinitionTagItem alarmDefinition = new AlarmDefinitionTagItem
{
DefinitionName = string.Format($“{textBoxAnalyticsEventName.Text} {deck}”),
EventTypeGroupId = (string)EventTypeGroup.Value,
EventTypeId = (string)_analyticsEventController.AlarmEvent.Value,
SourceList = (string)_selectedSourcePath.Value,
RelatedMapId = RelatedMap != null ? (string)RelatedMap.Value : “”,
PriorityId = Priority != null ? (string)Priority.Value : “”,
CategoryId = AlarmCategory != null ? (string)AlarmCategory.Value : “”
};

string list;

int errCount = 0;

AnalyticsEventContoller.DefinitionState state = _analyticsEventController.AddAlarmDefinition(alarmDefinition);

AddAlarmDefinition:

internal DefinitionState AddAlarmDefinition(AlarmDefinitionTagItem definitionItem)
{
ConfigurationItem result;
ConfigurationItem items;

try
{
    result = GetItem(VideoOS.ConfigurationAPI.ItemTypes.AlarmDefinitionFolder.ToString(), out string methodId);
    items = GetChildren(VideoOS.ConfigurationAPI.ItemTypes.AlarmDefinitionFolder.ToString());

    foreach (ConfigurationItem item in items)
    {
        if (item.DisplayName == definitionItem.DefinitionName)
        {
            return DefinitionState.Exist;
        }
    }

    var prop = result.Properties.Where(p => p.Key == "Name").FirstOrDefault();
    prop.Value = definitionItem.DefinitionName;

    prop = result.Properties.Where(p => p.Key == "EventTypeGroup").FirstOrDefault();
    prop.Value = definitionItem.EventTypeGroupId;

    prop = result.Properties.Where(p => p.Key == "EventType").FirstOrDefault();
    prop.Value = definitionItem.EventTypeId;

    prop = result.Properties.Where(p => p.Key == "SourceList").FirstOrDefault();
    prop.Value = definitionItem.SourceList;

    prop = result.Properties.Where(p => p.Key == "RelatedMap").FirstOrDefault();
    prop.Value = definitionItem.RelatedMapId;

    prop = result.Properties.Where(p => p.Key == "Priority").FirstOrDefault();
    prop.Value = definitionItem.PriorityId;

    prop = result.Properties.Where(p => p.Key == "Category").FirstOrDefault();
    prop.Value = definitionItem.CategoryId;

    result = _clientApi.InvokeMethod(result, methodId);
}
catch
{
    return DefinitionState.Failuer;
}

return DefinitionState.Ok;

}

I have created a bug report for Milestone Development. I will get back when I have feedback from Development.

1 Like

Hi Bo,
Is there any update on this yet?

Yes, there is a fix in testing. I will follow up. I hope soon to be able to point to it being available for you

1 Like