如何在c8y中使用事件处理脚本在数据资源管理器图形架构表中显示自定义信息

时间:2019-03-27 09:48:55

标签: cumulocity

信息从设备发送到c8y平台。参数值以十六进制表示,我们使用事件处理脚本将其转换为整数或字符串。转换后的值存储在数据库表中。

但是我们面临着一个挑战,即如何从数据库表中在驾驶舱应用程序的资源管理器图中显示值。

如果您可以使用事件处理脚本提供任何示例代码来显示图形,这将非常有帮助。

@Name("createdTempSchema") create schema UplinkUpdateEvent (msg string,time 
                           Date,msgid string); 
@Name("UplinkUpdateEvent") insert into UplinkUpdateEvent select 
                           event.event.source.value as msgid, 
                           event.event.time as time, 
                           getString(event, "objectResourceValue") as msg 
                           from EventCreated event 
                           where event.event.type.startsWith("c8y_UpLin"); 
@Name("createUplinkAlarm") insert into CreateAlarm select "c8y_UpLinkMsgAlarm" as type,
                           u.time as time,u.msgid as source,
                           "CRITICAL" as severity,
                           "ACTIVE" as status,
                           msg as text from UplinkUpdateEvent u 
                           where u.msg is not null;

0 个答案:

没有答案