我正在使用嵌入在WSO2 DAS中的WSO2 CEP 对于以下执行计划
it
每个输出事件产生两次具有相同值
<Node>
<A>
<B id = "it_DEN"></B>
</A>
<A>
<B id = "it_BEN"></B>
</A>
</Node>
@Import('RelatedStream:1.0.0')
define stream rs (ID string, product string, uc1 string, state string, brand string, model string, type string, tweet string, rtID string);
@Import('InputStream:1.0.0')
define stream ins (ID string, product string, uc1 string, state string, brand string, model string, type string, tweet string);
@Export('matchingStream:1.0.0')
define stream ms (rID string, rproduct string, ruc1 string, rstate string, rbrand string, rmodel string, rtype string, hID string, hproduct string, huc1 string, hstate string, hbrand string, hmodel string, htype string);
from ins#window.time(2 sec) as R
join rs#window.length(1) as H
on R.product == H.product and R.brand==H.brand and R.type==H.type and R.model==H.model and R.state!=H.state and R.ID==H.rtID
select R.ID as rID, R.product as rproduct , R.uc1 as ruc1 , R.state as rstate, R.brand as rbrand , R.model as rmodel , R.type as rtype ,H.ID as hID , H.product as hproduct , H.uc1 as huc1 , H.state as hstate , H.brand as hbrand, H.model as hmodel , H.type as htype
insert all events into ms;
08:23:21,845 [-] [DataBridge-Core-pool-1-thread-3] INFO TenantId : -1234, Event Processor : R_H_Match, Event Stream : InputStream:1.0.0 (ins), before processing _Event{timestamp=1464144801440, data=[27, phone, g1, sell, samsung, galaxy note, type, Use UM10 to get 10% OFF #unlockyourphone Galaxy Note 6 will reportedly be the first Samsung phone to feature US... sell], isExpired=false} (Sanitized)
答案 0 :(得分:1)
当您将所有事件插入到输出事件流中时,它包括当前事件(传入事件)和过期事件(在超时或超出窗口长度时由窗口发出)。因此有可能获得重复。
如果您的要求是使用“&rsquo;”的传入事件触发输出。流,您可以尝试以下内容:(使用当前事件)
from ins#window.time(2 sec) as R
join rs#window.length(0) as H
on R.product == H.product and R.brand==H.brand and R.type==H.type and R.model==H.model and R.state!=H.state and R.ID==H.rtID
select R.ID as rID, R.product as rproduct , R.uc1 as ruc1 , R.state as rstate, R.brand as rbrand , R.model as rmodel , R.type as rtype ,H.ID as hID , H.product as hproduct , H.uc1 as huc1 , H.state as hstate , H.brand as hbrand, H.model as hmodel , H.type as htype
insert current events into ms;