I can produce events from my plugin without problems, but now the client also wants us to be able to react to external events executing certain methods in in our plugin. I would first need to know if that is possible and if yes, then how could it be done
I will put example to clarify what we have need: we have methods such as deactivate an access control alarm or sensor, and it must be possible to execute this method in response to events generated outside our plugin, probably by other plugin from a different vendor.
Are you using Access Control Module integration?
Or the using the methods as shown in the Acces Control (MIP 2.0) sample?
Your pluign; is that an Event Server plugin or do you have a Smart Client plugin?
I have no idea what the Access Control Module integration is. I based my plugin on the Access control plugin sample in the SDK. In it I generate Milestone events which I have defined in the code everytime a hardware event is notified. Now the thing is responding to events not generated by my, either manual events or Analitics events… Not sure which ones are best for this. Once I’m able to detect this events it will be almost done.
About the plugin, it has a part that works on the Administration Client and another in the Smart Client.
The Access control plugin sample in the SDK includes context menu commands, can you use those?
Yes, I use then. Can I use the method TriggerReceiver registered through this line of code to process the other events comming from outside? Maybe I need a different MessageIdFilter
msgRef = EnvironmentManager.Instance.RegisterReceiver(TriggerReceiver, new MessageIdFilter(MessageId.Control.TriggerCommand));
Listening for events from the outside is best done using the NewEventsIndication. SCOverlayonEvent sample uses this.
I’ve been giving it a look, but still not too sure how we can use it for our purpose. Imagine we have a set of devices controlled from from our AccessControl plugin, and each of these devices have methods that can be executed through context menu commands, both on the Milestone maps using Items registered in the MIP or through our own interface in the plugin. In order to send orders to a certain device, we would need to be able to send it a message both with the action to perfom and also the identification of the destination device. This last thing I cannot see how to do it through manual event generation on the Milestone Administration Client. Am I missing something?
Another option would be if, considering that every device we control has an item registered in the MIP so that we can use it in the map, Is it possible that this items, somehow, expose their methods so that they can be executed through rules in the Administration Client?
I have just tried to catch both user defined events and Analytics events, both generated manually from the Administration client, and the NewEventIndicationMessageHandler method in the SCOverlayonEvent plugin sample does not detect them. On the contrary, it works fine with the event I generate from my plugin, but that is not what we need.
Yes. Doing manual events you would need one event for each combination, for each thing you would want to be able to trigger.
-
Using rules sounds to me like an exceleent idea. Please see in the MIP SDK Documentation: Introduction to Rule System integration.
-
Sounds strange if the SCOverlayonEvent sample does not work for you. First step of torubleshooting is whether the Event Server is running.
We have a sample for the rule system integration. It will be part of the next version MIP SDK but you can already see it here (http://download.milestonesys.com/MIPSDK/Samples/BatchRules.zip)
I gave it a look, but I don’t really see what it does and how we can use it. Can you explain a bit. There is no documentation at all and the comments are not enough to get a clear idea
There is a bit of documentation - Introduction to Rule System integration - in the MIP SDK Documentation. This is unfortunately all the documentation we have.