最佳, 尼科
答案 0 :(得分:2)
您可以这样做:
create schema Device as ManagedObject;
create schema CollectedDevices(
devices List
);
create schema SingleDevice(
device Device
);
insert into CollectedDevices
select
findAllManagedObjectByFragmentType("c8y_IsDevice") as devices
from pattern[timer:interval(10 seconds)];
insert into SingleDevice
select
singleDevice as device
from
CollectedDevices as devices unidirectional,
CollectedDevices[devices@type(Device)] as singleDevice;
然后将为列表中的每个元素触发最后一个语句。
您可以在此处找到联接的esper文档: http://esper.espertech.com/release-5.4.0/esper-reference/html/epl_clauses.html#epl-join