Hi,
I am seeing that when I mask a particular alarm the id of it gets changed.
So my scenario is, I show the alarms on LCA and want to give the functionality to user to mask or unmask the alarm from LCA via this script
var dmsElement = _dms.GetElement(element);
SetAlarmStateMessage maskAlarm = new SetAlarmStateMessage
{
AlarmId = Convert.ToInt32(alarmId),
DataMinerID = Convert.ToInt32(dmaId),
ElementID = dmsElement.Id,
State = 8,
};
maskAlarm.DesiredStatus = AlarmUserStatus.UnMask;
var response = _engine.SendSLNetMessage(maskAlarm);
So masking happens fine, I save the alarm id in DOM
Now, when he clicks for unmasking
I do :
var instance = domHelper.DomInstances.Read(domFilter).FirstOrDefault();
var elementName = instance.GetFieldValue<string>(Mcr_Dashboard.Sections.AlarmDetails.Id, Mcr_Dashboard.Sections.AlarmDetails.ElementName);
_engine.Log("AddOrReplaceFieldValue done");
var dmaId = instance.GetFieldValue<Int64>(Mcr_Dashboard.Sections.AlarmDetails.Id, Mcr_Dashboard.Sections.AlarmDetails.DmaId);
_engine.Log("AddOrReplaceFieldValue done");
if (instance != null)
{
var dmsElement = _dms.GetElement(elementName.Value);
domHelper.DomInstances.Delete(instance);
SetAlarmStateMessage unmaskAlarm = new SetAlarmStateMessage
{
AlarmId = Convert.ToInt32(alarmId),
DataMinerID = Convert.ToInt32(dmaId),
ElementID = dmsElement.Id,
State = 9,
};
unmaskAlarm.DesiredStatus = AlarmUserStatus.UnMask;
_engine.SendSLNetMessage(unmaskAlarm);
But, here I see since the alarm ID is changed it cannot find out and hence unmasking fails,
Is there any way if the ID is changing to have the new id after masking and then save in DOM
Hi Apurva,
Can you try masking the alarm root ID? Whenever there is an update on the alarm, a new alarm ID will be generated. However, the alarm toot ID will be the same.
Hope it helps.