为什么cepheus不将没有引号的int发送给orion? [英] Why cepheus don't send int without quotes to orion?

查看:52
本文介绍了为什么cepheus不将没有引号的int发送给orion?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在此问题中,我遇到一个问题,即不满足Orion条件,但通过删除特殊值上的引号解决了该问题.

In this question I have a problem that the orion conditions were not satisfied but it was solved by removing the quotes on the especial value Why this orion subscription don't works as I want?

新问题是,当我使用cep处理一个计算mFlag int属性的事件时,会将其发送给orion,但显然将其与引号一起发送(与之前发布的相关问题中所述的问题相同),因为orion实体已更改,但未触发通知.

The new problem is that when I process an event with cep that calculates the mFlag int attribute it send it to orion but apparently it is send with the quotes (same problem as described in the related question posted before) because the orion entity is changed but the notification is not triggered.

cepheus cep的配置如下:

The cepheus cep config out is like this one:

"out":[
    {
      "id":"algo",
      "type":"Event",
      "brokers":[
        {
          "url":"http://localhost:1026" //orion
        }
      ],
      "attributes":[
         { "name":"IdEvent", "type":"int" },
         { "name":"mFlag", "type":"int" }
      ]
    }
  ],

这个问题是cepheus cep的问题,还是不是在条件下无法解释属性类型的猎户座虫?

Is this problem of the cepheus cep or it is a orion bug not interpreting the type of the attribute in the conditions?

推荐答案

您似乎在Cepheus和Orion之间的NGSIv1协议实现中遇到了不兼容问题.

You seem to have hit an incompatibility in the NGSIv1 protocol implementation between Cepheus and Orion.

NGSIv1已针对其XML格式(作为OMA标准)进行了很好的定义,但对于其JSON版本却没有定义. Cepheus团队基于JSON实现,它是定义NGSIv1的JSON格式的唯一现有文档之一:

NGSIv1 has been well defined for its XML format (as a OMA standard), but not for its JSON version. The Cepheus team has based the JSON implementation one of the only existing document defining the JSON format of NGSIv1: the API Walkthough of the Orion documentation.

在本文档中,所有值都以字符串形式交换(例如标准格式的XML格式).因此,Cepheus使用字符串而不管其值的类型.

In this document, all values are exchanged (like in the XML format of the stantard) as strings. Therefore, Cepheus uses strings regardless of the type of the value.

如果我们决定使用除JSON字符串以外的其他表示形式作为值,则需要一个文档(NGSIv1 JSON的正确规范!)定义可以用JSON数字表示的类型.

If we were to decide to use some other representation than JSON strings for values, we would need a document (a proper specification for the NGSIv1 JSON !) defining which types can be represented as a JSON number.

这篇关于为什么cepheus不将没有引号的int发送给orion?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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