Skip to main content
1-Visitor
June 28, 2020
Solved

Create thingshape and add properties via services

  • June 28, 2020
  • 1 reply
  • 5457 views

Hi,

 

I am connecting to Thingworx server using java sdk's ConnectedThingsClient. I want to create a thing shape at run time and add properties to it. I am using CreateThingShape service from Resources.EntityServices. But I can not find any out of the box service to add property definitions to this shape. Unlike Things/ThingTempaltes, we do not have any generic services under ThingShapes. 

 

Is there any way we can do this using OOTB services/ other apis from java sdk?

 

Thank you

Best answer by vaishnavee

Frustrating as heck! PTC does not disappoint its reputation of incomplete documentations - there is not a single completed documentation for TW available on official sites of product / PTC support sites.

 

After wasting a whole day, I finally found the service - AddPropertyDefinition by accident. It uses similar api as the service with same name on Things and Templates etc.But the datashape used is different. The services from Thing,Template use the property names as IsLogged, IsReadOnly, IsRemote. And this on ThingShape needs logged, readOnly, remote etc. Also (for reasons unknown) the similar service AddPropertyDefinitions is not supported by ThingShapes.

 

They might be sharing the complete and informative documentation only with licensed customers. But they need to understand that there are use cases where people want to take/put the data out of/in to ThingWorx and need not necessarily have the licensed instance with them.

Hope that this is not a 'creating a mandatory dependency' thing and that the TW team is just too busy in development to publish the documentation. 

1 reply

vaishnavee1-VisitorAuthorAnswer
1-Visitor
July 1, 2020

Frustrating as heck! PTC does not disappoint its reputation of incomplete documentations - there is not a single completed documentation for TW available on official sites of product / PTC support sites.

 

After wasting a whole day, I finally found the service - AddPropertyDefinition by accident. It uses similar api as the service with same name on Things and Templates etc.But the datashape used is different. The services from Thing,Template use the property names as IsLogged, IsReadOnly, IsRemote. And this on ThingShape needs logged, readOnly, remote etc. Also (for reasons unknown) the similar service AddPropertyDefinitions is not supported by ThingShapes.

 

They might be sharing the complete and informative documentation only with licensed customers. But they need to understand that there are use cases where people want to take/put the data out of/in to ThingWorx and need not necessarily have the licensed instance with them.

Hope that this is not a 'creating a mandatory dependency' thing and that the TW team is just too busy in development to publish the documentation. 

Community Manager
July 2, 2020

Hi @vaishnavee.

 

We apologize for your frustration.  I am going to move forward to create an internal case for addressing the lack of completed documentation in the scenario you describe.

 

Please be assured we are constantly striving to improve our documentation, and we appreciate your feedback in helping us to achieve that goal.

 

Regards.

 

--Sharon

Community Manager
July 15, 2020

Hi @vaishnavee.

 

R&D is reviewing the documentation issue and would like to confirm which documentation were you using.  Was it the documentation delivered with the SDK or did you find it in Reference Docs or the ThingWorx Help Center?

 

Regards.

 

--Sharon