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

Community Tip - Need help navigating or using the PTC Community? Contact the community team. 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)