Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Introduction

This sample demonstrates how to use external time windows for a fraud detection use-case. In this sample, we look for two or more transactions done within a very short period of time and send an alert immediately when such an occurrence is detected.

 

The query used in this sample is as follows:

...

The second query looks for the condition where more than one transaction has taken place for a specific card and sends an alert. 

Prerequisites

See Prerequisites in CEP Samples Setup page.

 

Building the sample

Start the WSO2 CEP server with the sample configuration numbered 01090114. For instructions, see Starting sample CEP configurations. This sample configuration does the following:

  • Points the default Axis2 repo to <CEP_HOME>/sample/artifacts/01090114 (by default, the Axis2 repo is <CEP_HOME>/repository/deployment/server).

Executing the sample

  1. Open a terminal, go to <CEP_HOME>/samples/producers/wso2-event and run the following command:

    Code Block
    ant -DstreamId=org.wso2.sample.atm.transactions:1.0.0 -Dsn=01090114

    It builds and runs the wso2event producer, which sends sample ATM transaction events to the CEP server.

  2. From the terminal opened, see the details of the events sent. 

    Info

    To configure host, port, username, password use -Dhost=xxxx -Dport=xxxx -Dusername=xxxx -Dpassword=xxxx

  3. After sending events, you can see the outputs from the CEP console (the outputs are logged by the logger which we use for this sample), given below is part of the console output of the logger when sending events from the producer.

...