我有下面的规则,当心率保持在160以上5分钟时就会触发。
EPStatement cepStatementRule3 = cepRule.createEPL("context PartitionByMacHeartRate "
+ "select * from pattern[every(HeartRate(heartrate > 160) "
+ "-> (timer:interval(5 min) "
+ "and not HeartRate(heartrate<=160)))]");
cepStatementRule3.addListener(new rule3Listener());我的HeartRate类有以下字段:
int heartrate;
String heartratesTimestamp;
String macAddress;我想要的是能够在我的macAddress中获得ruleListener。然而,这将返回一个空的hashmap。因此,我的问题是如何返回macAddress of HeartRate?
发布于 2016-04-21 11:26:48
模式保留并返回标记的事件,即这样做:
// we assign the 'h' tag to the first event and the engine now retains that
// the select clause could use "h.macAddress as macAddress", for example
...every(h=HeartRate(... https://stackoverflow.com/questions/36766404
复制相似问题