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

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

fkuong
3-Visitor

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 3
CharlesJi
13-Aquamarine
(To:fkuong)

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

 

 

Hi Charles,

 

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

 

Thanks,

 

Freddy

CharlesJi
13-Aquamarine
(To:fkuong)

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

Announcements