Groovy Script: Get Precipitation by a given latitude and Longitude

This Groovy script gets the weather forecast for a given lat/long by calling an external web service.

Use in an Expression rule like this:

If: something
Then: SetDataItem ("precipitation", round(ExecuteCustomObject ("GetPrecipitation", location) ))

This sets the dataitem "precipitation" to the value returned by this script.

 Parameters

 Variable Name               Display Name
 location                         localtion (lat, lon)