<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to GroovyScripts</title><link>https://sourceforge.net/p/m2mlabs/wiki/GroovyScripts/</link><description>Recent changes to GroovyScripts</description><atom:link href="https://sourceforge.net/p/m2mlabs/wiki/GroovyScripts/feed" rel="self"/><language>en</language><lastBuildDate>Sun, 26 Apr 2015 20:47:13 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/m2mlabs/wiki/GroovyScripts/feed" rel="self" type="application/rss+xml"/><item><title>GroovyScripts modified by Jim</title><link>https://sourceforge.net/p/m2mlabs/wiki/GroovyScripts/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v4
+++ v5
@@ -29,4 +29,4 @@
 * getDevice(...) has to return a string holding the device id based on the received HTTP data
 * getSensorData(...) has to return the received data as a list of sensor data

-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](http://m2mlabs.com/sites/default/files/apidocs/).
+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](http://m2mlabs.com/sites/default/files/apidocs).
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jim</dc:creator><pubDate>Sun, 26 Apr 2015 20:47:13 -0000</pubDate><guid>https://sourceforge.net52216ec3c64a2652f8c726691da6c1276b156b00</guid></item><item><title>GroovyScripts modified by Jim</title><link>https://sourceforge.net/p/m2mlabs/wiki/GroovyScripts/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v3
+++ v4
@@ -29,4 +29,4 @@
 * getDevice(...) has to return a string holding the device id based on the received HTTP data
 * getSensorData(...) has to return the received data as a list of sensor data

-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 [Groovy Script Utilities](https://sourceforge.net/p/m2mlabs/wiki/ScriptUtil).
+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](http://m2mlabs.com/sites/default/files/apidocs/).
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jim</dc:creator><pubDate>Sun, 19 Apr 2015 20:07:02 -0000</pubDate><guid>https://sourceforge.net482b46584eee75783bc4b0c8b4d4b328510d006d</guid></item><item><title>GroovyScripts modified by Jim</title><link>https://sourceforge.net/p/m2mlabs/wiki/GroovyScripts/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v2
+++ v3
@@ -29,4 +29,4 @@
 * getDevice(...) has to return a string holding the device id based on the received HTTP data
 * getSensorData(...) has to return the received data as a list of sensor data

-The ScriptUtil class provides a set of functions to read, modify and create device data and configuration data, process device data and send notifications. They are described in [Groovy Script Utilities](https://sourceforge.net/p/m2mlabs/wiki/ScriptUtil).
+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 [Groovy Script Utilities](https://sourceforge.net/p/m2mlabs/wiki/ScriptUtil).
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jim</dc:creator><pubDate>Sun, 19 Apr 2015 19:35:05 -0000</pubDate><guid>https://sourceforge.net09b3f2d42652bd98c868559eed7cfb054e8c5509</guid></item><item><title>GroovyScripts modified by Jim</title><link>https://sourceforge.net/p/m2mlabs/wiki/GroovyScripts/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -4,16 +4,16 @@

 There are three types of scripts:

-* MomentProcessingScript: The script is called when ever new device data is received by the platform before it is written to the database, similar to an BEFORE INSERT trigger in a SQL database.
+* MomentProcessingScript: The script is called whenever new device data is received by the platform before it is written to the database, similar to a BEFORE INSERT trigger in a SQL database.
 * SocketConnectorScript: The script is called when a message is received on the optional raw socket interface of the platform.
 * HttpConnectorScript: The script is called when a message is received on the optional pure HTTP interface of the platform.

 ### MomentProcessingScript ###

-Purpose of this script is to provide application logic that cab 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 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:
+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:

-* check the validaty of the data with respect to min and max values
-* calculate derived values such as moving averages and add them to sensor attributes
+* check the validity of the data with respect to min and max values
+* calculate derived values such as averages and add them to sensor attributes
 * define thresholds and generate alarms or send email when a threshold is reached
 * change the configuration state of a device when certain device data are received

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jim</dc:creator><pubDate>Sun, 19 Apr 2015 19:29:00 -0000</pubDate><guid>https://sourceforge.net242ee2f078bd399a4223341c99d26e08f09bacd7</guid></item><item><title>GroovyScripts modified by Jim</title><link>https://sourceforge.net/p/m2mlabs/wiki/GroovyScripts/</link><description>&lt;div class="markdown_content"&gt;&lt;h3 id="create-a-groovy-script"&gt;Create a Groovy Script&lt;/h3&gt;
&lt;p&gt;Groovy scripts can be created by clicking the "Create Script" button on the main menu of the admin GUI at &lt;a href="http://localhost:8080/cs-ws" rel="nofollow"&gt;http://localhost:8080/cs-ws&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;There are three types of scripts:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;MomentProcessingScript: The script is called when ever new device data is received by the platform before it is written to the database, similar to an BEFORE INSERT trigger in a SQL database.&lt;/li&gt;
&lt;li&gt;SocketConnectorScript: The script is called when a message is received on the optional raw socket interface of the platform.&lt;/li&gt;
&lt;li&gt;HttpConnectorScript: The script is called when a message is received on the optional pure HTTP interface of the platform.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="momentprocessingscript"&gt;MomentProcessingScript&lt;/h3&gt;
&lt;p&gt;Purpose of this script is to provide application logic that cab 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 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:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;check the validaty of the data with respect to min and max values&lt;/li&gt;
&lt;li&gt;calculate derived values such as moving averages and add them to sensor attributes&lt;/li&gt;
&lt;li&gt;define thresholds and generate alarms or send email when a threshold is reached&lt;/li&gt;
&lt;li&gt;change the configuration state of a device when certain device data are received&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="socketconnectorscript"&gt;SocketConnectorScript&lt;/h3&gt;
&lt;p&gt;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:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;getDevice(...) has to return a string holding the device id based on the received socket data&lt;/li&gt;
&lt;li&gt;getSensorData(...) has to return the received data as a list of sensor data&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="httpconnectorscript"&gt;HttpConnectorScript&lt;/h3&gt;
&lt;p&gt;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:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;getDevice(...) has to return a string holding the device id based on the received HTTP data&lt;/li&gt;
&lt;li&gt;getSensorData(...) has to return the received data as a list of sensor data&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The ScriptUtil class provides a set of functions to read, modify and create device data and configuration data, process device data and send notifications. They are described in &lt;a class="" href="https://sourceforge.net/p/m2mlabs/wiki/ScriptUtil"&gt;Groovy Script Utilities&lt;/a&gt;.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Jim</dc:creator><pubDate>Sun, 19 Apr 2015 19:23:54 -0000</pubDate><guid>https://sourceforge.net0889b482ee7e28cc438773f1794f1160f43c14cd</guid></item></channel></rss>