Skip to main content
1-Visitor
Sep 25, 2019 9:52 PM UTC
Question

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

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

3 replies

Support
Sep 26, 2019 1:28 AM UTC

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);

 

 

Translate
fkuong1-VisitorAuthor
1-Visitor
Sep 26, 2019 12:53 PM UTC

Hi Charles,

 

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

 

Thanks,

 

Freddy

Translate
Support
Oct 14, 2019 3:25 AM UTC

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

Translate