cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

Axeda Groovy Script: Getting a list of device groups based on a deviceID

No ratings

This groovy script will return a list of DeviceGroups based off a given Asset's serialnumber.

import com.axeda.drm.sdk.device.*;

import com.axeda.drm.sdk.Context;

Context sysContext = Context.create();

DeviceGroupFinder dgf = new DeviceGroupFinder(sysContext);

DeviceFinder devFinder = new DeviceFinder(sysContext);

devFinder.setSerialNumber("[your serialnumber here]");

Device myDevice= devFinder.find();

dgf.setDeviceId(myDevice.getId());

List<DeviceGroup> allGroups = dgf.findAll();

allGroups.each

{ group ->

logger.debug(group.getName());

}

Version history
Last update:
‎May 26, 2016 05:28 PM
Updated by:
Labels (2)