Skip to main content
1-Visitor
September 25, 2019
Question

Error using Resources["EntityServices"].CloneThing(params)

  • September 25, 2019
  • 1 reply
  • 1573 views

Hello,

 

I have a simple service to clone an existing thing. I use Resources["EntityServices"].CloneThing and I got the following error:

JavaException: java.lang.Exception: Unable To Convert From org.json.JSONObject to INFOTABLE

 

When I duplicate the Thing manually in the Composer there is not problem I can duplicate the thing.

Could you please give some advice?

 

Thanks,

 

Freddy

1 reply

Support
September 26, 2019

Hi, 

 Can you please check the schema of params?

 It should be like the following:

 

var params = {
	name: "clone_target_thing" /* STRING */,
	description: "Description of clone" /* STRING */,
	sourceThingName: "clone_source_thing" /* THINGNAME */,
	tags: [{
 	"vocabulary" : "Test",
 "vocabularyTerm" : "CloneThingSnippet"
 }] /* TAGS */
};

Resources["EntityServices"].CloneThing(params);

 

 

fkuong1-VisitorAuthor
1-Visitor
September 26, 2019

Hi Charles,

 

My schema for params is correct, in my case description and Tags are undefined.

 

Thanks,

 

Freddy

Support
October 14, 2019

Hi, Freddy

 

Could you please send me the full code of your service, both the ApplicationLog.log and ScriptLog.log when you can reproduce the error message?

* The logs are located in <Thingworx Path>\ThingworxStorage\logs

 

Thanks,

Charles