Created
July 26, 2011 14:23
-
-
Save axeda/1106875 to your computer and use it in GitHub Desktop.
Add an asset to an asset group
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
| <!-- Add parameter "assetgroupname" --> | |
| import com.axeda.drm.sdk.device.DeviceGroupFinder | |
| import com.axeda.drm.sdk.device.DeviceGroup | |
| import com.axeda.drm.sdk.Context | |
| try { | |
| def assetgroupname = parameters.assetgroupname | |
| DeviceGroupFinder dgf = new DeviceGroupFinder(Context.create()) | |
| dgf.setName(assetgroupname ) | |
| DeviceGroup dg = dgf.find() | |
| dg.addDevice(context.device) | |
| dg.store() | |
| logger.info "Added " + context?.device?.serialNumber + " to " + dg.name + " -> " + dg.parentPath | |
| } | |
| catch(Exception e) | |
| { | |
| logger.error(e) | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment