ページの先頭行へ戻る
Interstage Big DataComplex Event Processing Server V1.1.0 ユーザーズガイド
FUJITSU Software

5.11.5 ルール定義

2種類のイベントを処理するルール定義です。フィルタールールと複合イベント処理ルールから構成されます。

5.11.5.1 フィルタールール(IF-THEN型ルール)

2種類のイベントに対するフィルタールールです。

 1
2
3
4
5
6
7
8
9
10
on LocationEvent {
if ($status == "1" AND lookup("StoreInfo", $areaID == $areaID) = true()) then
join("MemberInfo", $memberID==$ID)
output($memberID, $areaID, "MemberInfo".$age) as FilteredLocationEvent;
}

on CouponEvent {
join("StoreInfo", $storeID == $ID)
output($storeID, $couponID, $targetAge, "StoreInfo".$areaID) as FilteredCouponEvent;
}

以下は各行の説明です。

5.11.5.2 複合イベント処理ルール(SQL型ルール)

フィルタールールで処理された、2種類のイベントに対する複合イベント処理ルールです。

 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
create window outEventWin.std:firstunique(memberID,couponID).win:time(3 min)
as (memberID string, storeID string, couponID string);

@Name('EPL1')
insert into outEventWin
select loc.memberID as memberID,cpn.storeID as storeID,cpn.couponID as couponID
from FilteredLocationEvent as loc unidirectional
inner join FilteredCouponEvent.win:time(3 min) as cpn
on loc.areaID=cpn.areaID and loc.age=cpn.targetAge;

@Name('EPL2')
@DebugLogListener
select * from outEventWin;

@Name('filterOut1')
@DebugLogListener
select * from FilteredLocationEvent;

@Name('filterOut2')
@DebugLogListener
select * from FilteredCouponEvent;

以下は各行の説明です。