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

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

Get Thing Template implemented Thingshapes service

khayes1
15-Moonstone

Get Thing Template implemented Thingshapes service

Hi,

is there a service that will return a list of thingshapes implemented by a thing template (or thing derived from the thing template). Thought there would be as they are displayed in the composer, but can't find it.

 

Also looking for a service similar to GetServiceDefinitions() that will return the 'Category' parameter. That way I can filter the results so that I don't get all the services inherited from the base templates.

 

Thanks in advance.

K

 

ACCEPTED SOLUTION

Accepted Solutions
mnarang
17-Peridot
(To:khayes1)

// result: INFOTABLE dataShape: "EntityList"
var result = me.GetImplementedShapes();

 

GetImplementedShapes will give you the list of implemented shapes on entity .

 

There is one more for getting the implemented ThingTemplate 

 

var result = me.GetThingTemplate(); 

 

Thanks ,

Mukul Narang 

View solution in original post

6 REPLIES 6
mnarang
17-Peridot
(To:khayes1)

// result: INFOTABLE dataShape: "EntityList"
var result = me.GetImplementedShapes();

 

GetImplementedShapes will give you the list of implemented shapes on entity .

 

There is one more for getting the implemented ThingTemplate 

 

var result = me.GetThingTemplate(); 

 

Thanks ,

Mukul Narang 

khayes1
15-Moonstone
(To:mnarang)

Hi Mukul,

thanks for that, it is what I was looking for.

K

 

For the GetServiceDefinitions question it doesn't returns the Category, but you can filter by Category listing only the ones of the given Category ( if you know it in advance ).

khayes1
15-Moonstone
(To:CarlesColl)

Hi Carles,

thanks for the reply. Basically I am trying to get the service definitions of the services I personally added to a thing template. I don't want those that are inherited. Unfortunately I didn't add a category string when I created them. If I call the service without a category filter I get all the services (including the inherited ones). Is there a quick filter I can use in the category field or will I have to go through each service I wrote and add a category string first?

 

Thanks again,

K

 

Hello K,

 

If it are few services, just go and change the category with the composer, should be a moment. Otherwise you can export ThingTemplate for Source Control and search and remplace category="" to category="yourDesiredCategory" and import back.

 

Regards,

Carles.

khayes1
15-Moonstone
(To:CarlesColl)

Thank you, very helpful.

K

 

Announcements


Top Tags