サンプルアプリケーションの実行方法について説明します。
以下の作業において、コマンド実行は一般ユーザー権限で行います。
作業は以下の順番で行います。
CEPエンジンが一つだけ配備された状態(例:BDCEPの初期セットアップ完了直後)で、開発資産を配備します。
/opt/FJSVcep/sample/sample1/bin/deployall.shを実行します。
途中、何度か問い合わせが行われますが、全て<ENTER>と入力します。
$ cd /opt/FJSVcep/sample/sample1/bin <ENTER>
$ ./deployall.sh <ENTER>
Are you sure you want to deploy the event type definition?(default: y) [y,n,q]:<ENTER>
Command cepdeployrsc executed successfully.
Are you sure you want to deploy the event type definition?(default: y) [y,n,q]:<ENTER>
Command cepdeployrsc executed successfully.
Are you sure you want to deploy the event type definition?(default: y) [y,n,q]:<ENTER>
Command cepdeployrsc executed successfully.
Are you sure you want to deploy the event type definition?(default: y) [y,n,q]:<ENTER>
Command cepdeployrsc executed successfully.
Are you sure you want to deploy the rule definition?(default: y) [y,n,q]:<ENTER>
Command cepdeployrsc executed successfully.
Are you sure you want to deploy the master data definition?(default: y) [y,n,q]:<ENTER>
Command cepdeployrsc executed successfully.
Are you sure you want to deploy the master data definition?(default: y) [y,n,q]:<ENTER>
Command cepdeployrsc executed successfully.
このシェルスクリプト内部では以下のコマンドを実行しています。
イベントタイプ定義の配備
cepdeployrsc eventtype -f /opt/FJSVcep/sample/sample1/resources/LocationEvent.xml
cepdeployrsc eventtype -f /opt/FJSVcep/sample/sample1/resources/CouponEvent.xml
cepdeployrsc eventtype -f /opt/FJSVcep/sample/sample1/resources/FilteredLocationEvent.xml
cepdeployrsc eventtype -f /opt/FJSVcep/sample/sample1/resources/FilteredCouponEvent.xml
マスタ定義の配備
cepdeployrsc master -f /opt/FJSVcep/sample/sample1/resources/MemberInfo.xml
cepdeployrsc master -f /opt/FJSVcep/sample/sample1/resources/StoreInfo.xml
ルール定義の配備
cepdeployrsc rule -f /opt/FJSVcep/sample/sample1/resources/SampleRule.xml
以下のコマンドを実行し、CEPエンジンを起動します。
$ cepstarteng<ENTER>
イベント送信サンプルプログラム(/opt/FJSVcep/sample/sample1/bin/sendevent.sh)を使用してサンプルデータを送信し、エンジンログでルールの動作を確認します。
位置情報イベントの送信と結果の確認
$ ./sendevent.sh LocationEvent /opt/FJSVcep/sample/sample1/event/LocationEvent.csv<ENTER>
エンジンログに filterOut1 のイベントが出力されていることを確認します。
出力例
2012-07-09 11:11:57,409 [DEBUG] filterOut1:length=1
filterOut1[0]
areaID :2222: String
age :30: String
memberID :MEM0008: String
2012-07-09 11:11:57,413 [DEBUG] filterOut1:length=1
filterOut1[0]
areaID :2222: String
age :20: String
memberID :MEM0003: String
クーポンイベントの送信と結果の確認
$ ./sendevent.sh CouponEvent /opt/FJSVcep/sample/sample1/event/CouponEvent.csv<ENTER>
エンジンログに filterOut2 のイベントが出力されていることを確認します。
出力例
2012-07-09 11:15:38,054 [DEBUG] filterOut2:length=1
filterOut2[0]
areaID :2222: String
targetAge :30: String
storeID :STR0001: String
couponID :CPN0001: String
位置情報イベントの送信と結果の確認
クーポンイベント送信後3分以内に位置情報イベントを送信します。
$ ./sendevent.sh LocationEvent /opt/FJSVcep/sample/sample1/event/LocationEvent.csv<ENTER>
エンジンログにクーポン発行を示すイベントが出力されていることを確認します。
出力例
2012-07-09 11:17:25,314 [DEBUG] filterOut1:length=1
filterOut1[0]
areaID :2222: String
age :20: String
memberID :MEM0003: String
2012-07-09 11:17:25,321 [DEBUG] filterOut1:length=1
filterOut1[0]
areaID :2222: String
age :30: String
memberID :MEM0008: String
2012-07-09 11:17:25,323 [DEBUG] EPL2:length=1
EPL2[0]
storeID :STR0001: String
memberID :MEM0008: String
couponID :CPN0001: String
位置情報イベントの送信と結果の確認
クーポンイベント送信後3分以内にもう一度位置情報イベントを送信します。
$ ./sendevent.sh LocationEvent /opt/FJSVcep/sample/sample1/event/LocationEvent.csv<ENTER>
エンジンログにクーポン発行を示すイベントが二重に出力されていないことを確認します。
出力例
2012-07-09 11:18:00,691 [DEBUG] filterOut1:length=1
filterOut1[0]
areaID :2222: String
age :20: String
memberID :MEM0003: String
2012-07-09 11:18:00,691 [DEBUG] filterOut1:length=1
filterOut1[0]
areaID :2222: String
age :30: String
memberID :MEM0008: String
以下のコマンドを実行し、CEPエンジンを停止します。
$ cepstopeng<ENTER>
/opt/FJSVcep/sample/sample1/bin/undeployall.sh を実行して、一括で配備解除を行います。
途中、何度か問い合わせが行われますが、全て<ENTER>と入力します。
$ ./undeployall.sh<ENTER>
Are you sure you want to undeploy the event type definition?(default: y) [y,n,q]:<ENTER>
Command cepundeployrsc executed successfully.
Are you sure you want to undeploy the event type definition?(default: y) [y,n,q]:<ENTER>
Command cepundeployrsc executed successfully.
Are you sure you want to undeploy the event type definition?(default: y) [y,n,q]:<ENTER>
Command cepundeployrsc executed successfully.
Are you sure you want to undeploy the event type definition?(default: y) [y,n,q]:<ENTER>
Command cepundeployrsc executed successfully.
Are you sure you want to undeploy the rule definition?(default: y) [y,n,q]:<ENTER>
Command cepundeployrsc executed successfully.
Are you sure you want to undeploy the master data definition?(default: y) [y,n,q]:<ENTER>
Command cepundeployrsc executed successfully.
Are you sure you want to undeploy the master data definition?(default: y) [y,n,q]:<ENTER>
Command cepundeployrsc executed successfully.