首页 文章

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

提问于
浏览
0

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

例如,"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

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

    如何在运行时替换文件它应该工作!告诉我你是否找到了不同的方法 . 最好的祝福!

相关问题