Top
Interstage Big Data Complex Event Processing Server V1.0.0 User's Guide
Interstage

5.9.5 Rule Definition

The rule definition processes two types of events. It consists of filter rules and complex event processing rules.

5.9.5.1 Filter Rules (IF-THEN Format)

These filter rules are for two types of events.

 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;
}

Below is an explanation of each line.

5.9.5.2 Complex Event Processing Rules (SQL Format)

These complex event processing rules are for the two types of events processed by the filter rules.

 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
create schema outEvent (memberID string, storeID string, couponID string);

create window outEventWin.std:firstunique(memberID,couponID).win:time(3 min) as outEvent;

@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;

Below is an explanation of each line.