TIBCO BusinessEvents Fraud Detection Sample

This topic describes how to run the TIBCO BusinessEvents "Fraud Detection with StreamBase" sample application, which illustrates how to use TIBCO BusinessEvents and StreamBase CEP together using BusinessEvents' StreamBase channel.

Sample Overview

This sample is made up of two parts, one running in TIBCO BusinessEvents and one in StreamBase. The sample is a variation on BusinessEvents' popular Fraud Detection sample, only modified to use a StreamBase application to implement the fraud detection logic.

Strictly speaking, the StreamBase part of the sample is BusinessEvents-agnostic; it simply exposes an input stream to receive a tuple describing a bank debit transaction, applies the fraud detection logic, and emits a tuple on an output stream if fraud is suspected.

The BusinessEvents side of the sample provides the facilities for managing the bank account(s) and processing the actual debit transactions. It makes use of its StreamBase channel to exchanges tuples with the StreamBase application.

This Sample's Files

The StreamBase side of this sample has the following files:

  • The sample EventFlow application, BusinessEventsFraudDetection.sbapp, and its associated layout file.

TIBCO BusinessEvents version 5.3 and above ships with the corresponding BE sample called FraudDetectionStreamBase. Both the BE and SB samples must be run together on the same network (or the same machine) for the sample to function as expected.

Running This Sample

The StreamBase sample should be started first as it acts as a server for the fraud detection services.

The steps to run this sample in StreamBase Studio are as follows:

  1. In the Package Explorer, double-click to open the BusinessEventsFraudDetection.sbapp application.

  2. Make sure the application is the currently active tab in the EventFlow editor, then click the Run button. This opens the SB Test/Debug perspective and starts the application.

  3. The application is now ready to receive tuples from the BusinessEvents sample.

  4. Follow the steps below to run the BusinessEvents side of the sample.

  5. When done running the sample, press F9 or click the Stop Running Application button.

To load the BE side of the sample in BusinessEvents Studio, select File | Import... | General/Existing Projects into Workspace, and navigate to %TIBCO_HOME%\be\<version>\examples\standard\FraudDetectionStreamBase.

To run the BusinessEvents sample, look under your BusinessEvents install directory in examples/standard/FraudDetectionStreamBase. In this directory you will find a readme.html file that describes the BE sample and how to run it.

Importing This Sample into StreamBase Studio

In StreamBase Studio, import this sample with the following steps:

  • From the top-leve menu, select FileLoad StreamBase Sample.

  • Type businessevents to narrow the list of options.

  • Select TIBCO BusinessEvents Fraud Detection from the Extending StreamBase category.

  • Click OK.

StreamBase Studio creates a project named BusinessEventsFraudDetection in your current Studio workspace.

Sample Location

When you load the sample into StreamBase Studio, Studio copies the sample project's files to your Studio workspace, which is normally part of your home directory, with full access rights.

Important

Load this sample in StreamBase Studio, and thereafter use the Studio workspace copy of the sample to run and test it, even when running from the command prompt.

Using the workspace copy of the sample avoids permission problems. The default workspace location for this sample is:

studio-workspace/sample_BusinessEventsFraudDetection

See Default Installation Directories for the location of studio-workspace on your system.

In the default TIBCO StreamBase installation, this sample's files are initially installed in:

streambase-install-dir/sample/BusinessEventsFraudDetection

See Default Installation Directories for the default location of studio-workspace on your system.