This custom object writes "Registration Rule" and the name of the asset (device) to the Platform log. After typing a name and selecting the Registration Rule type, provide your own description and then copy and paste the source code below into the Source Code box in the Create Custom Object page. This example uses the device.getName() attribute of the Device object.
Name: RegistrationObject (Name)
Type: Registration Rule (type)
Description: (type your own)
Source Code:
try
{
logger.info("Registration Rule" + device.getName());
logger.info(parameters.get("infoValue"));
return true;
}catch(Exception e)
{
logger.error(e);
}
Parameters: None
The return code indicates that the registration rule information was written to the log successfully.
For a list of attributes for a Device object, refer to Device Object Attributes.