@Sathishkumar_C In that case I think the issue might be that you are attempting start / enable of thing on template level and that's not possible. You need to attempt that on the object , something like this
@ThingworxServiceDefinition(name = "CreateAThing", description = "", category = "", isAllowOverride = false, aspects = {
"isAsync:false" })
@ThingworxServiceResult(name = "Result", description = "", baseType = "BOOLEAN", aspects = {})
public void CreateAThing() throws Exception {
_logger.trace("Entering Service: CreateAThing");
_logger.trace("Exiting Service: CreateAThing");
EntityServices newThingService = new EntityServices();
String name = "UniqueThingName";
String desc = "Static Thing from Custom Extension";
TagCollection myTag = null;
try {
newThingService.CreateThing(name, desc, myTag, "ExtensionStandardNew");
} catch (Exception e) {
System.out.println("Failed to create Thing");
e.printStackTrace();
}
Thing mything = (Thing) EntityUtilities.findEntity(name, ThingworxRelationshipTypes.Thing);
_logger.trace("Failed to find thing", mything.getName());
try {
mything.EnableThing();
} catch (Exception e) {
System.out.println("Failed to enable thing" + mything.getName());
e.printStackTrace();
}