Hi,
I succeeded in generating Event that appears in Alarm and EventViewer sample from the SDK but I cannot get a rule triggered by this event when the event is triggered by an app.
If I trigger the event from configurator the rule (based on event) is executed and I see in Alarm and event viewer sample . But when the same event is triggered by my app I cannot get this working…
here is the code I use to trigger the event :
EventSource eventSource = new EventSource()
{
FQID = eventItem.FQID,
Name = [eventItem.Name](https://eventItem.Name)
};
EventHeader eventHeader = new EventHeader()
{
ID = Guid.NewGuid(),
Class = "NewEventToRule",
Type = "Event",
Timestamp = DateTime.Now,
Message = "Alarm Obs",
Name = " alarm.ObsName",
Source = eventSource
};
// In this sample the snap shots are being saved. This will make the
// the build-in AlarmPreview in Smart Client display them in the case where the event result in an alarm.
//EventSequence eventSequence = new EventSequence();
//EventData eventData = new EventData()
//{
// EventHeader = eventHeader,
// EventSequence = eventSequence
//};
//EnvironmentManager.Instance.SendMessage(new VideoOS.Platform.Messaging.Message(MessageId.Server.NewEventCommand) { Data = eventData });
Alarm alrm = new Alarm()
{
EventHeader = eventHeader,
StateName = "In progress",
State = 4
// Basic user with the name of test in this example
// the string to use can be seen in the Smart Client dropdown
// Other fields could be filled out, e.g. objectList
};
EnvironmentManager.Instance.SendMessage(new VideoOS.Platform.Messaging.Message(MessageId.Server.NewAlarmCommand) { Data = alrm });
AS you can see in comments I tried to generate event as an alarm or not => same behavior…
I tried to do it with a userdefined Event and with an analytics event => same behavior …
can you help ???
Thanks and regards