Thingworx:自定义"GetImplementingThings"服务 [英] Thingworx: Customize `GetImplementingThings` service

查看:131
本文介绍了Thingworx:自定义"GetImplementingThings"服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是ThingWorx的新手,我想在此示例中获得一些实现服务的实用技巧. 我有这样的数据模型:

汽车"具有传感器"(信息表)

我想使用CarTemplate的服务,该服务将返回所有已实现的Car,并且将返回Sensor的'name'属性,而不是Sensor的Object.

我现在所拥有的:

"Car1Name" |  SensorObject

我想要什么:

"Car1Name" | "Accelerator1Name"

请帮我实现它.

解决方案

ThingTemplates上没有任何一种静态"服务,如果您要恢复具有属性值的ThingTemplate的所有实现功能,则应构建Thing Helper./p>

什么是Thing Helper?这是另一回事,随便叫什么,比如说CarHelpers,它有一个名为GetCarsWithSensors的服务,该服务执行ThingTemplates ["ThingTemplateName"].GetImplementingThings()或GetImplementingThingsWithData并返回所需的Infotable.

I am new to ThingWorx and I want to get some practical flavour of implementing services on this example. I have such data model:

Thing 'Car' has Thing 'Sensor'(Infotable)

I want to have service of CarTemplate that will return all implemented Cars and instead of Sensor's Object it will return Sensor's 'name' property.

What I have now:

"Car1Name" |  SensorObject

What I want:

"Car1Name" | "Accelerator1Name"

Please, help me to make it happens.

解决方案

There's no kind of "Static" services on ThingTemplates, if you want to recover all Implementing things of a ThingTemplate with properties values you should build a Thing Helper.

What's a Thing Helper? It's another thing, call it whatever you want, let's say CarHelpers, which has a Service called GetCarsWithSensors, which does a ThingTemplates["ThingTemplateName"].GetImplementingThings(), or a GetImplementingThingsWithData and returns the desired Infotable.

这篇关于Thingworx:自定义"GetImplementingThings"服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆