在运行时在Cepheus-CEP中插入规则

时间:2018-01-03 16:57:35

标签: fiware complex-event-processing

我开始探索Fiware工具,我正在测试Cepheus-CEP。 我知道我可以在" config.json"中设置规则和其他配置参数。 Cepheus在启动服务时采取的文件,但我不知道如何在执行时间中指定这些规则。

例如," config.json" could be

{
  "host":"http://localhost:8080",
  "in":[
    {
      "id":"RoomX",
      "type":"Room",
      "attributes":[
        { "name":"temperature", "type":"double" },
        { "name":"shutter", "type":"string" }
      ]
    }
  ],
  "out":[
    {
      "id":"ShutterX",
      "type":"Shutter",
      "attributes":[
        { "name":"status", "type":"string" }
      ]
    }
  ],
  "statements":[
    "INSERT INTO Shutter SELECT R.r.shutter as id, 'closed' as status FROM pattern [ every r=Room(temperature > 26.0) -> (timer:interval(5 sec) and not Room(temperature < 26.0 and id=r.id))] as R unidirectional LEFT OUTER JOIN Shutter.std:groupwin(id).std:lastevent() as S ON R.r.shutter = S.id WHERE S is null OR S.status = 'opened'",
    "INSERT INTO Shutter SELECT R.r.shutter as id, 'opened' as status FROM pattern [ every r=Room(temperature < 24.0) -> (timer:interval(5 sec) and not Room(temperature > 24.0 and id=r.id))] as R unidirectional LEFT OUTER JOIN Shutter.std:groupwin(id).std:lastevent() as S ON R.r.shutter = S.id WHERE S is null OR S.status = 'closed'"
  ]
}

我想在执行期间更改语句(规则)列表,是否有查询或我可以使用的内容?

1 个答案:

答案 0 :(得分:0)

我担心Cepheus CEP中没有CRUD API,根据我的经验,你应该立即更换整个配置文件。

如何在运行时更换文件它应该可以工作! 告诉我你是否找到了不同的方法。 最好的问候!