将配置文件发送到fiware cepheus cep GE时出错

时间:2017-02-09 12:31:06

标签: fiware complex-event-processing

我在使用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]"}

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

1 个答案:

答案 0 :(得分:0)

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

这些是受支持的属性类型:stringintlongfloatdoubleboolean,{{1} }和date