Groovy scripts can be created by clicking the "Create Script" button on the main menu of the admin GUI at http://localhost:8080/cs-ws
There are three types of scripts:
Purpose of this script is to provide application logic that can directly executed on the platform when new data is available. There is no limit on the number of moment processing scripts. The script has to implement the IMomentProcessingScript interface with the run(...) method, It has to be assigned to the device model in the "Scripts" section by clicking the "AddScript" button. If several scripts are assigned to the device model all of them are executed one after the other in arbitrary order. Typical tasks of moment processing scripts are:
Task of the script is to process the socket data and return a list of sensor data for further processing by the platform. There is only one such script possible per tenant. The script has to implement the ISocketConnectorScript interface with two methods:
Task of the script is to process the HTTP data and return a list of sensor data for further processing by the platform. There is only one such script possible per tenant. The script has to implement the IHttpConnectorScript interface with two methods:
The ScriptUtil class provides a set of functions to read, modify and create device data and configuration data, process device data, send notifications and get access to EJBs for further opeartions to be performed. They are described in the API Doc.