unfortunately this functionality of the SC works only with the built-in alarm definitions.
Namely, there is no information in the alarm about the maps, that has to be shown on the map. Instead, UI searches for the alarm definition, that this alarm was triggered from and checks what is written in the alarm definition configuration (what map type/instance is set-up there).
Having that in mind, the only way to trick the SC UI and make it show a particular map is to pretend that your alarm was triggered by alarm definition.
So you have to create a real alarm definition, configure what map (instance) to be used for the alarms coming from it and set the alarm definition Id in the rulesList of the Alarm. The tricky point here is that this “fake” alarm definition should not generate actual alarms. So you have to configure for it some event that is not used into the system at all.
The code would look something like:
Guid AlarmRuleType_BuiltinAlarmDefinition = new Guid("4547f085-8b68-4639-826f-8722afb0ffc5");
var ruleList = new RuleList();
ruleList.Add(new Rule()
{
// the ID of the alarm definition, with configured map instance
ID = Guid.Parse("bac88821-3cdf-43c9-bdf9-21fcf6c559f2"),
// fixed type of the built-in alarm definitions (rules)
// use only that type !!!
Type = AlarmRuleType_BuiltinAlarmDefinition.ToString(),
});
Alarm alarm = new Alarm()
{
EventHeader = eventHeader,
StateName = "New",
State = 1,
ReferenceList = refList,
RuleList = ruleList,
};
EnvironmentManager.Instance.SendMessage(new VideoOS.Platform.Messaging.Message(MessageId.Server.NewAlarmCommand) { Data = alarm });
Not the best dev experience, but this is how it is.
This workaround works for Non-Federated sites. However, it does not seem to work for federated sites. Is there a solution for a Federated Site? Because the DummyAlarm we create is on the Parent Site, there is no dummy alarm on the child site. Even though we create DummyAlarm on the child site, the AlarmID will differ.