【问题标题】:Error on sending configuration file to fiware cepheus cep GE将配置文件发送到 fiware cepheus cep GE 时出错
【发布时间】:2017-02-27 23:58:48
【问题描述】:

我在使用 cepheus cep Fiware 组件时遇到了问题。我准备了 config.json 文件,设置传入和输出数据的结构,以及应该处理传入数据并生成配置中预设结构的输出数据的 Esper SQL 语句。我想用传感器运动数据向 Cepheus 发送更新,告知是否有人进入房间(发送 1)或有人离开房间(发送 -1),然后将运动输入值与房间中之前的人数相加以查看如果房间里还有人。这是我到目前为止制作的json配置文件。

{
        "host":"http://localhost:8080",
"in":[
    {
      "id":"Lab.*",
      "type":"Lab",
      "isPattern": true,
      "attributes":[
        { "name":"motion", "type":"integer","metadata": [
            { "name":"unit", "type":"string" }
          ] }
    ,

{ "name":"controller", "type":"string"}],

      "providers":[
        "http://localhost:8081"
      ]
    }
  ],

"out":[
    {
      "id":"ControllerX",
      "type":"Controller",
      "attributes":[

    {  "name":"number", "type":"integer"

       }

]
,

      "brokers":[
        {
          "url":"http://147.27.60.58:1026"
        }
      ]
    }
  ],
"statements":[ "INSERT INTO Controller  SELECT controller as id , motion prev(count(*)+number) as number From Lab.win:keepall()  INNER JOIN Controller.win:keepall() ON controller = id    

" 

    ]

如文件所示,该语句在从最后一个输出事件中获取先前的人数后生成输出事件,并将其与运动输入(1 或 -1)相加得到新输出事件的人数,但是当我发送 config.json 文件我收到此错误:

{"code":"400","reasonPhrase":"Failed to apply new configuration","details":"Error starting statement: Failed to validate select-clause expression 'motion+number': Implicit conversion from datatype 'Object' to numeric is not allowed [insert into Controller select controller as id, motion+number as number from Lab.win:keepall() inner outer join Controller.std:lastevent() on controller = id]"}

这个错误是否意味着总和值被识别为对象而不是整数?如果是这样,怎么解决?

【问题讨论】:

    标签: fiware complex-event-processing


    【解决方案1】:

    您是否尝试使用 Cepheus CEP 支持的属性类型,在本例中为 int

    这些是受支持的属性类型:stringintlongfloatdoublebooleandategeo:point

    【讨论】:

    • 非常感谢..我成功解决了使用“int”和“double”两种类型进行测试的问题
    猜你喜欢
    • 1970-01-01
    • 2023-03-30
    • 2015-01-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-04-25
    • 2018-03-02
    相关资源
    最近更新 更多