Scripting & JS API
Scripts can be used for filtration or generation of new events, processing external HTTP requests and management of other Viinex objects. Script execution is usually initiated by events that come from other objects. In addition to it we have provided a capability to activate a script using HTTP API provided by Viinex server. Thus, every script can also be a servlet if needed. In other words, external software like a code that is executed by a webpage in a client browser, can directly activate a script in Viinex by sending it HTTP requests and receive HTTP responses formed by this script.
Scripts can be particularly useful when there is a need to secure the reliability of executing the logic chosen by a partner by minimizing the risk of event loss in distributed systems (communication failures, restarting one of the components of the system etc) that this logic is based upon. A case in point could be a realization of PTZ camera control and priority through the use of the scripts, PTZ camera return to presets in some time after being used by an operator or switching to a video stream with a higher resolution if an ONVIF event from this camera detector is received.
Besides, a script can also publish some information that can later be sent to clients in response to their HTTP requests without accessing the script itself. This is important for productivity: a host of remote clients can simultaneously request information published by the script and quickly get a response, while the script will continue processing new events.
By way of example, this is the script mechanism and link with an external process that we used to create a solution for railcar number recognition.