Created
July 26, 2011 14:31
-
-
Save axeda/1106896 to your computer and use it in GitHub Desktop.
Setting a Model Property script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import com.axeda.drm.sdk.device.*; | |
| try | |
| { | |
| logger.info "params ${parameters.name} -> ${parameters.value}" | |
| DevicePropertyFinder dpf = new DevicePropertyFinder (context.context) | |
| dpf.type = PropertyType .DEVICE_TYPE | |
| dpf.id = context.device.id | |
| DeviceProperty dp = dpf.findOne() | |
| List<Property> props = dp.getProperties() | |
| props.each {Property prop-> | |
| if (prop.name.equals(parameters.name)) | |
| { | |
| logger.info "set ${parameters.name} to ${parameters.value}" | |
| prop.value = parameters.value | |
| } | |
| } | |
| dp.store() | |
| } catch(Exception e) | |
| { | |
| logger.info e.getMessage(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment