+ All Categories
Home > Documents > TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an...

TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an...

Date post: 19-Aug-2020
Category:
Upload: others
View: 1 times
Download: 0 times
Share this document with a friend
66
TIBCO BusinessEvents® Extreme Getting Started Software Release 1.3.1 Published June 26, 2015
Transcript
Page 1: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

TIBCO BusinessEvents® Extreme

Getting Started

Software Release 1.3.1Published June 26, 2015

Page 2: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

Important InformationSOME TIBCO SOFTWARE EMBEDS OR BUNDLES OTHER TIBCO SOFTWARE. USE OF SUCH EMBEDDED OR BUNDLED TIBCOSOFTWARE IS SOLELY TO ENABLE THE FUNCTIONALITY (OR PROVIDE LIMITED ADD-ON FUNCTIONALITY) OF THE LICENSEDTIBCO SOFTWARE. THE EMBEDDED OR BUNDLED SOFTWARE IS NOT LICENSED TO BE USED OR ACCESSED BY ANY OTHERTIBCO SOFTWARE OR FOR ANY OTHER PURPOSE.

USE OF TIBCO SOFTWARE AND THIS DOCUMENT IS SUBJECT TO THE TERMS AND CONDITIONS OF A LICENSE AGREEMENTFOUND IN EITHER A SEPARATELY EXECUTED SOFTWARE LICENSE AGREEMENT, OR, IF THERE IS NO SUCH SEPARATEAGREEMENT, THE CLICKWRAP END USER LICENSE AGREEMENT WHICH IS DISPLAYED DURING DOWNLOAD OR INSTALL-ATION OF THE SOFTWARE (AND WHICH IS DUPLICATED IN LICENSE.PDF) OR IF THERE IS NO SUCH SOFTWARE LICENSEAGREEMENT OR CLICKWRAP END USER LICENSE AGREEMENT, THE LICENSE(S) LOCATED IN THE “LICENSE” FILE(S) OFTHE SOFTWARE. USE OF THIS DOCUMENT IS SUBJECT TO THOSE TERMS AND CONDITIONS, AND YOUR USE HEREOF SHALLCONSTITUTE ACCEPTANCE OF AND AN AGREEMENT TO BE BOUND BY THE SAME.

This document contains confidential information that is subject to U.S. and international copyright laws and treaties. No part of this documentmay be reproduced in any form without the written authorization of TIBCO Software Inc.

TIB, TIBCO, TIBCO Adapter, Predictive Business, Information Bus, The Power of Now, Two-Second Advantage, TIBCO ActiveMatrixBusinessWorks, are either registered trademarks or trademarks of TIBCO Software Inc. in the United States and/or other countries.

EJB, Java EE, J2EE, and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. in theU.S. and other countries.

All other product and company names and marks mentioned in this document are the property of their respective owners and are mentionedfor identification purposes only.

THIS SOFTWARE MAY BE AVAILABLE ON MULTIPLE OPERATING SYSTEMS. HOWEVER, NOT ALL OPERATING SYSTEMPLATFORMS FOR A SPECIFIC SOFTWARE VERSION ARE RELEASED AT THE SAME TIME. SEE THE README FILE FOR THEAVAILABILITY OF THIS SOFTWARE VERSION ON A SPECIFIC OPERATING SYSTEM PLATFORM.

THIS DOCUMENT IS PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING,BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.

THIS DOCUMENT COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLYADDED TO THE INFORMATION HEREIN; THESE CHANGES WILL BE INCORPORATED IN NEW EDITIONS OF THIS DOCUMENT.TIBCO SOFTWARE INC. MAY MAKE IMPROVEMENTS AND/OR CHANGES IN THE PRODUCT(S) AND/OR THE PROGRAM(S)DESCRIBED IN THIS DOCUMENT AT ANY TIME.

THE CONTENTS OF THIS DOCUMENT MAY BE MODIFIED AND/OR QUALIFIED, DIRECTLY OR INDIRECTLY, BY OTHERDOCUMENTATION WHICH ACCOMPANIES THIS SOFTWARE, INCLUDING BUT NOT LIMITED TO ANY RELEASE NOTES AND"READ ME" FILES.

Copyright © 2012, 2015 TIBCO Software Inc. ALL RIGHTS RESERVED, TIBCO Software Inc. Confidential Information

Page 3: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

ContentsPreface ............................................................................................................................ xi

Related Documentation ............................................................................................. xiConventions ............................................................................................................ xiiConnecting with TIBCO Resources ............................................................................ xii

1. Introduction ................................................................................................................... 1Overview .................................................................................................................. 1Skills Required .......................................................................................................... 1Installation ................................................................................................................ 1Scenario .................................................................................................................... 2

2. Project Tutorial .............................................................................................................. 7General Runtime Flow ................................................................................................ 7Importing Existing Project into Your Workspace ........................................................... 8Create the FraudDetection Project ............................................................................... 8Add an HTTP Channel and Destination ...................................................................... 12Define AccountOperation, Create, Debit, and Enable Events ......................................... 16Define the Account and History Concepts ................................................................... 21Add the PreProcessor Rule Function .......................................................................... 25Add DuplicateAccountCheck and CreateAccount Rules ................................................ 27Add ApplyDebit, InvalidAccount, and CheckBalance Rules ........................................... 32Add the FraudDetection, EnableAccount, and DisabledAccount Rule ............................. 36Analyze and Validate the Project ................................................................................ 39Add a Cluster Deployment Descriptor and Build the EAR File ....................................... 41

3. Deployment .................................................................................................................. 47Starting Nodes ......................................................................................................... 47Deploying the Application ......................................................................................... 48Sending Events ........................................................................................................ 50Congratulations ........................................................................................................ 51

Index .............................................................................................................................. 53

iii

Page 4: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

iv

Page 5: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

List of Figures1.1. Create Account Scenario ............................................................................................... 31.2. Debit Account Scenario ................................................................................................ 41.3. Enable Account Scenario .............................................................................................. 6

v

Page 6: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

vi

Page 7: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

List of Tables2.1. Debit Event ................................................................................................................ 192.2. Enable Event .............................................................................................................. 202.3. History Concept Properties ......................................................................................... 222.4. Account Concept Properties ........................................................................................ 23

vii

Page 8: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

viii

Page 9: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

List of Examples2.1. ApplyDebit Rule Source View Code .............................................................................. 332.2. InvalidAccount Rule Source View Code ........................................................................ 352.3. CheckBalance Rule Source View Code ......................................................................... 362.4. FraudDetection Rule Source ........................................................................................ 372.5. EnableAccount Rule Source ......................................................................................... 382.6. DisabledAccount Rule Source ...................................................................................... 393.1. Installing a node ......................................................................................................... 473.2. Starting a node ........................................................................................................... 483.3. Deploying the application ............................................................................................ 49

ix

Page 10: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

x

Page 11: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

PrefaceTIBCO BusinessEvents® Extreme is a high-performance event processing platform for applicationsthat monitor, analyze, and respond to parallel event streams in and across the enterprise, makingdecisions, taking action, and running services in real-time. TIBCO BusinessEvents® Extreme deliversdramatic new levels of performance, scalability, and robustness for demanding Complex EventProcessing (CEP) and real-time event-driven applications.

The platform automatically manages consistency for efficient parallel processing and high verticalscalability, while freeing applications from the complexity of concurrent and distributed programming.A hybrid Rules and Java programming model enables applications to maximize the capabilities ofboth languages, seamlessly share data and events, and integrate to existing Java assets.

Related DocumentationThis section lists documentation resources you may find useful.

TIBCO BusinessEvents® Extreme DocumentationThis book is part of a set of TIBCO BusinessEvents® Extreme documentation, which also includes:

TIBCO BusinessEvents® Extreme Installation — Read this manual for instructions on sitepreparation and installation, and project migration.

TIBCO BusinessEvents® Extreme Application Architect's Guide — Read this guide foroverview and detailed technical information to guide your application design work.

TIBCO BusinessEvents® Extreme Architect's Guide — This guide provides a technical overviewof TIBCO BusinessEvents® Extreme .

TIBCO BusinessEvents® Extreme Administration — This book explains how to configure,deploy, monitor, and manage a TIBCO BusinessEvents® Extreme application and the data it gen-erates using the TIBCO BusinessEvents® Extreme Administrator utility and other utilities providedwith the product.

TIBCO BusinessEvents® Extreme Java Developer's Guide — Use this guide to programTIBCO BusinessEvents® Extreme in Java.

TIBCO BusinessEvents® Extreme Application Developer's Guide — Use this guide to programTIBCO BusinessEvents® Extreme rules.

TIBCO BusinessEvents® Extreme Performance Tuning Guide — Read this guide for inform-ation about tuning your TIBCO BusinessEvents® Extreme application.

TIBCO BusinessEvents® Extreme Sizing Guide — Read this guide for information on how tosize systems for deploying TIBCO BusinessEvents® Extreme applications.

TIBCO BusinessEvents® Extreme Javadoc — The reference documentation for all TIBCOBusinessEvents® Extreme APIs.

TIBCO BusinessEvents® Extreme Release Notes — Read the release notes for a list of newand changed features. This document also contains lists of known issues and closed issues for thisrelease.

xi

Page 12: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

Other TIBCO Product DocumentationYou may find it useful to refer to the documentation for the following TIBCO products:

• TIBCO ActiveSpaces®

• TIBCO Enterprise Message Service®

• TIBCO Rendezvous®

ConventionsThe following conventions are used in this book:

Bold — Used to refer to particular items on a user interface such as the Event Monitor button.

Constant Width — Used for anything that you would type literally such as keywords, data types,parameter names, etc.

Constant Width Italic — Used as a place holder for values that you should replace with anactual value.

Connecting with TIBCO ResourcesThis section provides links to helpful TIBCO resources.

How to Join the TIBCO DevZoneThe TIBCO DevZone is an online destination for TIBCO customers, partners, and resident experts,a place to share and access the collective experience of the TIBCO community. The DevZone offersforums, documentation, examples, and access to other resources. To register, go to ht-tp://devzone.tibco.com. [https://devzone.tibco.com]

How to Access TIBCO DocumentationYou can access TIBCO documentation here - http://docs.tibco.com.

How to Contact TIBCO SupportFor comments or problems with this manual or the software it addresses, contact TIBCO Supportas follows:

• For an overview of TIBCO Support, and information about getting started with TIBCO Support,visit http://www.tibco.com/services/support

• If you already have a valid maintenance or support contract, visit https://support.tibco.com. Entryto this site requires a user name and password. If you do not have a user name, you can requestone.

xii

Preface

Page 13: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

1Introduction

This brief chapter provides an overview of the tutorials and the tutorial scenario used in this guide.

OverviewThis guide contains tutorials based on one simplified business scenario. The tasks in the tutorialsprovide step-by-step instructions and explain the main ideas so you gain understanding as well aspractical knowledge. References to related information are provided so you can jump to the detaileddocumentation to learn more.

The Chapter 2 shows you how to create a TIBCO BusinessEvents® Extreme application. The ap-plication in Chapter 2 implements the fraud detection scenario in the section called “Scen-ario” on page 2.

The Chapter 3 shows you how to start TIBCO BusinessEvents® Extreme nodes and deploy thefraud detection application.

Skills RequiredThis guide is written for users with little or no familiarity with TIBCO products. Readers shouldhave some familiarity with Java programming and the Eclipse platform.

InstallationThe tutorials in this guide require that TIBCO BusinessEvents® Extreme is installed on all machinesthat will used for deployment and development. In addition, the Eclipse Platform must be installedon all machines that will be used for development. See the TIBCO BusinessEvents ExtremeInstallation guide for details.

1

Page 14: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

ScenarioThis tutorial implements these different scenarios:

• Create an account

• Debit an account

• Enable an account

Each of these scenarios is triggered by a different external event from an HTTP channel.

The create an account scenario is shown in Figure 1.1. This scenario creates an account from in-formation in the create account event if the account does not already exist.

2

Chapter 1. Introduction

Page 15: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

Create AccountEvent

Channel picks upa create account

message

Accountexists? Report error

Create theAccount

Start

Create AccountEvent

Channel picks upa create account

message

Accountexists? Report error

Yes

Create theAccount

No

Start

Stop

Sto

p

Figure 1.1. Create Account Scenario

The debit account scenario is shown in Figure 1.2. This scenario performs the following steps whena debit account event is received:

1. If the account is disabled, no action is taken.

2. Debit the account with the amount in the event. The maximum amount that will be debited isthe current account balance.

3. If the balance is now zero, disable the account.

4. If fraud is detected, disable the account.

3

Scenario

Page 16: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

Debit AccountEvent

Channel picks upa debit account

message

Accountdisabled?

Do not debitaccount

Yes

Debit the account

Balancezero?

Disable theAccount

Fraudsuspected?

Disable theAccount

Yes

Yes

No

No

No

Start

Stop

Sto

pS

top

Sto

p

4

Chapter 1. Introduction

Page 17: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

Figure 1.2. Debit Account Scenario

To establish whether fraud is suspected, the frequency, and amount of debits in a rolling time windowis used. Fraud is suspected when either of the following criteria is met:

• An account incurs more than three debit transactions in a two minute period.

• The sum of the debits in the two minute period totals more than 80% of the average monthly balanceof the account.

Accounts with suspected fraud are disabled.

The enable account scenario is shown in Figure 1.3. This scenario simply enables an account if itexists and is disabled when an enable account event is received.

5

Scenario

Page 18: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

Enable AccountEvent

Channel picks upa enable account

message

Accountexists?

No

Enable theAccount

Yes

Start

Stop

Sto

p

Figure 1.3. Enable Account Scenario

6

Chapter 1. Introduction

Page 19: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

2Project Tutorial

This tutorial takes you through all the steps of configuring, building, deploying, and testing a TIBCOBusinessEvents® Extreme project. The emphasis is on basic project design, with deploy timeactivities limited to the basic actions required to demonstrate the application.

General Runtime FlowThe scenarios that are implemented by the application are described in the section called “Scen-ario” on page 2. This section explains in more technical terms what happens at runtime given adebit that triggers the fraud detection rules. (You will learn more details about the terms shown initalics below, as you complete the tutorial steps):

1. A message arriving through a TIBCO BusinessEvents® Extreme channel is transformed into anevent. (At design time you create an event type for this purpose, with the appropriate properties.)The event instance is then asserted into the Rete network, an in-memory network of objects basedon the Rete algorithm, which enables fast matching of facts with rule dependencies.

2. The presence of this new event in the Rete network causes the inference engine to check forrules that are designed to be triggered when this event is asserted.

3. A rule that is triggered by this event executes. A rule might make changes to concept instances,create an event and send it to a channel (and out of the TIBCO BusinessEvents® Extreme applic-ation to some destination), and so on. The rule then consumes the event unless there is a reasonto persist the event.

Event lifespan It is important to consume events when they are no longer needed so thatthey do not trigger rules to fire erroneously. On the other hand, it is also important to usea long enough time-to-live (TTL) setting for an event, so that it exists long enough toperform all work needed, for example, to trigger rules that correlate multiple events andtake appropriate actions.

7

Page 20: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

Importing Existing Project into Your Work-space

It is recommended that you complete the tutorials yourself, because learning by doing is the mosteffective way to become proficient. If completing the tutorials is not possible, however, you can readthe tutorials and refer to the complete project - FraudDetection, shipped with TIBCO Busines-sEvents® Extreme .

Copy Project Directory Trees Before ImportingAt deploy time the only files that are used are the EAR and CDD files. When you deploy an application,these files must be available.

To Import a Project Into Your Workspace1. Start TIBCO BusinessEvents® Extreme Studio.

• In Windows, click Start > All Programs > TIBCO > YourEnvironment > TIBCOBusinessEvents® Extreme > TIBCO BusinessEvents® Extreme Studio.

• In Linux, cd TIBCO_HOME/be/5.1/studio/eclipse. Execute the studio executablein that directory.

2. As needed, create a workspace for your tutorial projects. Select File > Switch Workspace> Other and select the directory you want to use or create a new directory.

3. Select File > Import > General > Existing Projects Into Workspace, thenclick Next.

4. In the Select Root Directory, browse to a directory above the desired project directory and clickOK.

All TIBCO BusinessEvents® Extreme Studio projects within the selected directory are listed.

5. Select the projects you want to import.

6. Check or uncheck the Copy projects to workspace check box to suit your needs. It’s upto you how you manage your files.

7. Click Finish. The selected projects appear in Studio Explorer.

Create the FraudDetection ProjectIn this task, you start TIBCO BusinessEvents® Extreme Studio and create an empty project.

What is TIBCO BusinessEvents® Extreme Studio? TIBCO BusinessEvents® Extreme Studiois the Eclipse-based user interface for TIBCO BusinessEvents® Extreme . It enables you to build,test, and debug projects. Use of this industry-standard development framework shortens yourlearning curve and enables you to take advantage of common tools and facilities.

8

Chapter 2. Project Tutorial

Page 21: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

What are the TIBCO BusinessEvents® Extreme Perspectives? TIBCO BusinessEvents®Extreme Studio adds these Eclipse perspectives:

• TIBCO BusinessEvents® Extreme Studio Debug

• TIBCO BusinessEvents® Extreme Studio Development

• TIBCO BusinessEvents® Extreme Studio Diagram

TIBCO BusinessEvents® Extreme switches perspectives transparently depending on the editoryou are working with.

What are the bottom tabs? In the lower part of the user interface are various tabs used as needed:

• Console The Console view displays and logs errors that occur while running TIBCO BusinessEv-ents® Extreme Studio.

• Error Log The Error Log view captures all the warnings and errors logged by Eclipse plug-ins.The log file itself has the extension .log file and it is stored in the .metadata subdirectory ofthe workspace.

• Problems The Problems view reports all validation errors in the project, including languagevalidation errors, access control errors, and so on. It also displays messages relating to the project

9

Create the FraudDetection Project

Page 22: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

analyzer. Double-click a problem entry to open the associated editor. See the section called“Analyze and Validate the Project” on page 39 for more details.

• Properties The Properties view shows meta-data about a resource. To view the meta-data, clickthe resource in TIBCO BusinessEvents® Extreme Studio Explorer. Not all resources use thistab.

• Rule Input. The Rule Input view is used to provide debug data to test rules during development.

How should I organize project folders? When you create a new project a set of folders is created.You can use a different folder structure to organize your project components in any way you like.Projects should be kept simple and use provided folder names such as Concepts, Events, Rules,Java. More complex projects might use a different folder hierarchy with names that relate to thepurpose or contents of the folders.

Project Tasks in TIBCO BusinessEvents® Extreme Application Developer’s Guidediscusses actions you can take at the project level such as importing projects, validatingprojects, using project libraries, and so on.

Create the Fraud Detection Project Task Steps1. Start TIBCO BusinessEvents® Extreme Studio.

• In Windows, click Start > All Programs > TIBCO > Your Environment > TIBCOBusinessEvents® Extreme > Studio.

• In Linux, cd TIBCO_HOME/be/5.1/studio/eclipse. Execute the studio executablein that directory.

2. The first time you run TIBCO BusinessEvents® Extreme Studio, a Welcome screen displays.You can access this guide from the Welcome page. Click the X next to Welcome to dismiss thescreen.

3. As needed, create a workspace for your tutorial projects. Select File > Switch Workspace> Other and select the directory you want to use. You can create a new directory.

4. Right click in the TIBCO BusinessEvents® Extreme Studio Explorer view (the panel on the left,where the project folders will display), and select New > Project. You see the New Projectwizard.

5. From the list, select TIBCO BusinessEvents® Extreme > Studio Project.

Then click Next.

6. In the New Studio Project dialog, enter the project name FraudDetection, and click Finish.(If you want to use a non-default location, uncheck the Use default location check boxand select the location.)

10

Chapter 2. Project Tutorial

Page 23: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

In the TIBCO BusinessEvents® Extreme Studio Explorer, the root folder of the project is calledFraudDetection. It has a set of project subfolders.

In addition you may see links for various diagrams: FraudDetection.conceptview,FraudDetection.eventview and FraudDetection.projectview. These are respectivelyconcept model, event model, and project (or element) diagrams. Diagrams are created dynamicallyand are not saved. More diagrams are available for other purposes. They are UML compliant,with some exceptions. Some diagrams are created only when requested.

11

Create the FraudDetection Project

Page 24: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

7. Save the project.

• To save all changes to all resources in a project (since last save), click File > Save Allor click Ctrl+Shift+S.

• To save changes in just the currently viewed resource, click File > Save or click Ctrl+S,or click the Save button.

Summary and Next StepsYou have created a new empty project in the TIBCO BusinessEvents® Extreme Studio Developmentperspective.

Next you will begin to define your TIBCO BusinessEvents® Extreme project by building a channelfor information to enter the deployed application, and a destination for the application to listen to.

The order in which you build up the project is not fixed. For example, instead you might define theproject ontology first.

Add an HTTP Channel and DestinationIn this task you configure an HTML channel with one destination. The AllOperations destinationlistens for messages that come from HTTP forms embedded in the project’s readme.html file.

12

Chapter 2. Project Tutorial

Page 25: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

What are channels and destinations? Messages enter and leave the system through channels.You create destinations within a channel to define the message sources and sinks. Typically, eventsare created using data in incoming messages; outgoing messages are created using data from events.Later in the tutorial, you will set up the relationship between these destinations and the event typesthat they listen to by default.

Note that in this tutorial outbound messages are simply sent to the console, so there are no outbounddestinations.

How are channels and destinations created? You create channels and destinations at design-time, as explained below. When you are planning TIBCO BusinessEvents® Extreme projects, youwould consider the incoming and outgoing messages for your project, and then define the channels,destinations, and the corresponding event types — outbound events are transformed into appropriatemessages, and inbound messages are transformed into events of a specified type.

Why Use Shared Resources? Shared resources are generally used in channels to configurecommunication with some external system such as HTTP clients or a JMS server. You can configurethe connection once and use it in multiple places. If some configuration has to be changed, you justhave to change it in one place.

It’s a good idea to use global variables in shared resources so that projects can be quicklyadapted to run in different environments.

See Channels and Destinations, and JMS Channels chapters in the TIBCO BusinessEv-ents® Extreme Application Developer’s Guide.

Add an HTTP Connection1. Select the SharedResources folder and press Ctrl+N. You see the Select a Wizard dialog.

(You could also get here using File > New > Other.)

2. Select TIBCO Shared Resources > HTTP Connection and click Next.

3. In the New HTTP Connection Wizard, name the connection HTTPConnection and click Finish.(In a real world situation you would probably give the connection a more meaningful name.) Yousee the HTTP Connection dialog.

Resource names and directory names in the path to a resource cannot be any ofthe keywords or other words listed in the Rule Language Grammar chapter in TIBCOBusinessEvents® Extreme Application Developer’s Guide, and they cannotcontain spaces.

4. In the Host field, enter localhost.

5. In the Port field, enter 8108. This is the default port used in the readme.html for this project.

13

Add an HTTP Channel and Destination

Page 26: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

6. Save the resource (File -> Save) and close it.

Add an HTTP Channel and Destination1. Right-click the Channels folder and select New > Channel.

2. You see the New Channel Wizard.

a. In the Channel Name field, type HTTP.

This value is case sensitive. Ensure that you use all capital letters.

b. In the Description field, type An HTTP channel.

c. In the Driver Type field, select HTTP.

d. Click Finish. You see the Channel editor

You cannot change the channel name in the editor after you click Finish in thenew resource wizard. You can change the description, however. You can later renamethe resource using a shortcut menu refactoring option.

3. In the Resource field, browse to and select the HTTP connection resource you created in thesection called “Add an HTTP Connection” on page 13. Only valid shared resources for the currentresource display.

14

Chapter 2. Project Tutorial

Page 27: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

4. In the Destinations section, click Add and name the destination AllOperations. You need toclick on the assigned default name and use the Rename pop-up to change the name. Leave allother fields set to their default values.

5. Save and close the resource.

All messages arriving at a destination are transformed to the destination’s default event,unless the message specifies a different event. Adding a default event, however, doesstop a warning sign from appearing! — this warning draws your attention to the factthat a destination does not have a default event, but does not indicate an error.

Default events and destinations are explained in the next step.

Summary and Next StepsNow you have built a channel and a destination within that channel to listen for messages. The nextstep is to create some events.

15

Add an HTTP Channel and Destination

Page 28: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

Define AccountOperation, Create, Debit, andEnable Events

In this task, you begin to build the project ontology by defining some events — or strictly speaking,event types. Before you define event types in a real-world project, you first examine the incomingand outgoing messages, as well as messages that you want to occur within the application, andconfigure each event type’s characteristics accordingly. You can use inheritance (as demonstratedhere) to simplify configuration.

TIBCO BusinessEvents® Extreme provides various kinds of events. Simple events are used in thistutorial to bring messages into the application. In addition you can use SOAP events, time eventsand advisory events, which you can learn about in the product documentation.

What is an event? The term event is overloaded: it means an activity that happens, and the definitionof an object that represents the activity in TIBCO BusinessEvents® Extreme (an event type), andan instance of that event type definition.

How are events (event instances) created? Simple event types are created at design time. Eventinstances are generally created using data in incoming messages. When a destination receives amessage, it creates an event to hold the information from the message. Events from channels areautomatically asserted into the Rete network, where their presence generally triggers rules (if allrule conditions are met).

Simple events can also be created by rules and rule functions. Events created this way are not assertedautomatically because they could be intended for use as outbound events, to be sent to a destination.You must explicitly assert such internally created events as needed.

What is an event payload? Just as messages have properties and a message body, events canhave properties and payloads. The payload is optional. It is used to hold more complex data, forexample, SOAP messages.)

What is a default destination? Outbound events of the same event type are often sent to the samedestination. To simplify the process of sending those events, you can specify a default destinationin the event type.

What is a default event? The default event configured for a destination is used to hold informationtransferred from an incoming message, when no event type is specified in the message.

See Default Destinations and Default Events in TIBCO BusinessEvents® Extreme ApplicationArchitect’s Guide for more details.

Why do the events have a warning sign? Just as destinations generally have default events,events generally have default destinations. The warning is to alert you to the fact that an event hasno default destination. In this case, however, no events are sent out through channels so no defaultis required.

Rules that apply to a parent type also apply to its child types Concept and event types useinheritance in a similar way to Java classes. Because rules that apply to a parent type also apply toits child types, it is generally not advisable to create many levels of inheritance. However it can bea useful technique. In this tutorial the AccountOperations event is the parent of the Create,Debit, and Enable events. You’ll see why in a later section.

16

Chapter 2. Project Tutorial

Page 29: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

See Channels and Events in TIBCO BusinessEvents® Extreme Application Archi-tect’s Guide for overview and conceptual information.

See Simple Events, Time Events, and Scheduler Functions, and Advisory Events in TIBCOBusinessEvents® Extreme Application Developer’s Guide for implementation details.

Define the AccountOperations EventThis event is a parent to events that are used in the project. It has one property: identifier. Allits child events inherit this property, and extend the parent by adding more.

1. Right click the Events folder, and select New > Simple Event.

2. You see the New Simple Event Wizard. In the Simple Event Name field, type AccountOpera-tions. In the Description field, type Parent event for all account related events.Click Finish.

3. In the Default Destination field, click the browse button and in the Select Destination dialog, selectFraudDetection/Channels/HTTP.channel/AllOperations. Click OK.

4. You see the Simple Event Editor. In the Properties section, click the Add button. Click in the cellunder Name and type the name identifier.

This property is a String property, and String is the default type.

17

Define AccountOperation, Create, Debit, and EnableEvents

Page 30: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

5. Save and close the resource.

Define the Create EventFor example purposes, the information needed to create an account is an identifier, a balance, anda monthly average balance (for the fraud detection calculation). The identifier property is in-herited from the AccountOperations event.

1. Right click the Events folder, and select New > Simple Event.

2. In the New Simple Event Wizard Filename field, type Create. In the Description field, typeTriggers the CreateAccount rule to create an account. Click Finish.

3. In the Simple Event Editor Inherits From field, click Browse. In the upper section of the eventpicker, select the Simple Event event type, and in the lower section browse to and select theAccountOperations event. Click OK. The AccountOperations event is now the parentevent for the Create one.

4. In the Default Destination field, click the browse button and in the Select Destination dialog, selectFraudDetection/Channels/HTTP.channel/AllOperations. Click OK.

18

Chapter 2. Project Tutorial

Page 31: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

5. In the Properties section, add two properties:

• balance, of type double

• averageMonthlyBalance, of type double

6. Save and close the resource.

In any editor, you can click any label that is underlined (such as Inherits From in theEvent editor) to open the resource selected for that setting.

Define the Debit EventFollowing the procedure above, add the Debit event with the values in Table 2.1 on page 19.

Table 2.1. Debit Event

ValueField

DebitName

Specifies an account and a debit amount.Description

19

Define AccountOperation, Create, Debit, and EnableEvents

Page 32: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

ValueField

AccountOperationsInherits From

/Channels/HTTP.channel/AllOperationsDefault Destination

amount (double)Properties

The Debit event should look like this when it is complete.

Define the Enable EventFollowing the procedure above, add the Enable event with the values in Table 2.2 on page 20.

Table 2.2. Enable Event

ValueField

EnableName

Re-enable an account and reset the balance.Description

AccountOperationsInherits From

/Channels/HTTP.channel/AllOperationsDefault Destination

20

Chapter 2. Project Tutorial

Page 33: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

ValueField

balance (double)Properties

The Enable event should look like this when it is complete.

Summary and Next StepsNext you will continue to configure the project ontology by defining concepts.

Define the Account and History ConceptsIn this task, you define the Account and History concepts.

The Account concept holds basic information about an account: an identifier, a balance, a status,an average monthly balance, and recent debit activity. You also learn some useful information aboutconcepts and how they are used.

The History concept contains record of a debit against a specific account. This information isused to detect fraud.

21

Define the Account and History Concepts

Page 34: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

What is a concept? A concept type is a definition of a set of properties that represent the data fieldsof an entity. Concept types are like Java classes, and concept instances are like Java objects.

How are concept instances created? Concept instances are created by rules, rule functions, ordirectly in Java. Information from event properties or payloads is often used to create concept in-stances, but other information can be used, for example, the results of a query or a calculation.

Keys Concepts can have application specific keys. Unique and non-unique keys are supported. Keyscan be ordered or unordered. The property identifier is defined as an unordered unique keyfor the Account concept. This identifier must be unique for all Account concepts. The Historyconcept has a non-unique ordered key on the identifier and at properties. The identifieris the account that is associated with the History concept. This is called a foreign key in databaseterminology. The at property is used to ordered the History concepts based on time.

Concept Relationships Concepts can have containment and reference relationships with otherconcepts. You set these up as concept properties, and define the kind of relationship by selectingan appropriate data type for the property. For example, a car concept can contain Wheel concepts,and can have a reference relationship to a Dealership concept.

Inheritance Concepts can also inherit from other concepts (as events can inherit from other events).Inheritance is a programming relationship and not an ontology relationship. It enables you to extenda base type for more efficient project management. See the section called “Define AccountOperation,Create, Debit, and Enable Events” on page 16 for important information about inheritance.

How are concepts persisted? Instances of concepts (and events) are also known as “facts” and“entities.” They are persisted in shared memory and optionally replicated to one more more nodes.

See Concepts in TIBCO BusinessEvents® Extreme Application Architect’s Guide.

See Concepts in TIBCO BusinessEvents® Extreme Application Developer’s Guide.

Define the History Concept1. Right click the Concepts folder, and select New > Concept.

2. You see the New Concept Wizard. In the Filename field, type History. In the Description field,type Maintain debit history for an account. Click Finish.

3. In the History concept editor Properties section, add the following properties:

Table 2.3. History Concept Properties

DescriptionTypeName

Debit amount.doubleamount

When debit occurred.DateTimeat

Account identifierStringidentifier

4. In the History concept Keys section, define a new non-unique, ordered key named ByAccountby clicking on the Add button. Update the key to have these values:

• Key Name - ByAccount

• Unique - Unchecked

22

Chapter 2. Project Tutorial

Page 35: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

• Ordered - Checked

• External Identifier - Unchecked

• Properties - identifier at

5. Save and close the resource.

Define the Account Concept1. Right click the Concepts folder, and select New > Concept.

2. You see the New Concept Wizard. In the Filename field, type Account. In the Description field,type This concept maintains history for account transactions. Click Finish.

3. In the Account Concept Editor Properties section, add the following properties:

Table 2.4. Account Concept Properties

DescriptionTypeName

Unique account identifier.Stringidentifier

Current account balance.doublebalance

23

Define the Account and History Concepts

Page 36: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

DescriptionTypeName

Current account status - Enabled or Disabled.Stringstatus

Average monthly balance.doubleaverageMonthlyBalance

Recent debit activity on this accountdoublerecentDebitBalance

4. In the Account concept Keys section, define a new unique, unordered key named ByIdentifierby clicking on the Add button. Update the key to have these values:

• Key Name - ByIdentifier

• Unique - Checked

• Ordered - Unchecked

• External Identifier - Unchecked

• Properties - identifier

5. Save and close the resource.

24

Chapter 2. Project Tutorial

Page 37: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

Summary and Next StepsYou have defined a concept type to hold information about bank accounts. The next step is to adda preprocessor.

Add the PreProcessor Rule FunctionIn this task, you configure a rule function that replies to the request received from the HTTPchannel. HTTP is a request-reply protocol, and this step is required so that the HTTP server is readyto process the next request from the readme.html form. This rule function executes when anevent is received. (You’ll configure that connection later.)

What is a rule function? A rule function is a function you write in the TIBCO BusinessEvents®Extreme rule language.

How are rule functions created and used? You write rule functions using the rule editor. Youcan use rule functions in rules and other rule functions, in event preprocessors, and as startup orshutdown functions.

What other types of functions are there? TIBCO BusinessEvents® Extreme provides a largelibrary of functions for various purposes. In addition, an ontology function is automatically createdfor each concept and event in your project. These are constructor functions. Query functions arealso automatically generated for each key defined on a concept. Another type of ontology functionenables you to create and schedule a timed event. You can also add custom Java functions.

See Rules and Functions in TIBCO BusinessEvents® Extreme Application Architect’sGuide.

Relevant chapters in the TIBCO BusinessEvents® Extreme Application Developer’sGuide.

What is an event preprocessor? An event preprocessor is a rule function that processes incomingmessages before TIBCO BusinessEvents® Extreme transforms them into events. In this case thepreprocessor is used to send a response to the HTTP server. In real-world applications, however, apreprocessor might filter the messages so that only certain ones are used as events, and it mightdo other event enrichment actions. Preprocessors are multi-threaded and you can choose fromvarious threading and queue options, as appropriate to handle the work load. By default thethreading uses the system-wide shared queue and threads.

How are event preprocessors configured for use? A preprocessor is associated with a destination.It processes events arriving at that destination. See the section called “Add a Cluster DeploymentDescriptor and Build the EAR File” on page 41 for details.

See Event Preprocessors in TIBCO BusinessEvents® Extreme Application Architect’sGuide.

See Event Preprocessors in TIBCO BusinessEvents® Extreme Application De-veloper’s Guide.

Add the PreProcessor Rule Function1. Right click the RuleFunctions folder, and select New > Rule Function

25

Add the PreProcessor Rule Function

Page 38: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

2. You see the New Rule Function Wizard. In the Rule Function name field, type PreProcessor.In the Description field, type Generates a response to an HTTP request. Click Finish.

3. Click the Form tab at the bottom of the editor.

4. In the Scope section, click Add.

5. You see the Select Rule Function Scope Arguments dialog. In the Types area (at the top), selectEvent. Click OK.

In the Select Resource area, you could select a specific event type in the project. However, herewe want any event to be in the scope of this rule function, not one specific event type.

6. In the Alias column (in the Scope section), replace the default alias (e) with request.

7. In the Body area, type: Event. (Event followed by a period). Notice that when you type theperiod (.) you see a list of all catalog functions in the Event category. Use the down arrow toscroll down the list of functions and stop at replyEvent. Its tooltip displays. Documentationfor all catalog functions is provided in tooltips.

8. Click the replyEvent function to select it. Now the body looks like this: Event.replyEvent(

As you can see, the rule function arguments are two events, a request event and a reply event.

9. To specify the request event, type request, the alias for the scope argument you added above.

10. To specify the reply event, just type request again. The reply event can be any event in thiscase, so we can simply reply with the request event.

26

Chapter 2. Project Tutorial

Page 39: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

11. Save and close the resource.

Summary and Next StepsYou have configured a rule function that will send a reply to requests sent by an HTTP client (throughthe HTTP channel). Next you will configure rules that take an action on assertion of Create,Debit, and Enable events, depending on various conditions.

Add DuplicateAccountCheck and CreateAc-count Rules

In this task you create two rules, one called CreateAccount and one called DuplicateAc-countCheck. Both rules can fire when a Create event is asserted into the Rete network. However,the DuplicateAccountCheck rule has a higher priority, so it will fire before the CreateAccountrule.

The DuplicateAccountCheck rule checks whether the account identifier provided in the Createevent matches the account identifier of any Account instance already in the Rete network. One ofthe two following situations must occur:

27

Add DuplicateAccountCheck and CreateAccountRules

Page 40: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

• A matching identifier exists in the Rete network: the DuplicateAccountCheck rule prints amessage to the console, and consumes — that is, deletes — the Create event. Because that eventis consumed, the CreateAccount rule does not fire.

• No matching identifier exists in the Rete network: the DuplicateAccountRule rule doesnothing, and then the CreateAccount rule fires, and creates the Account concept instance.

What are rules and how are they created? Rules define actions to take when certain conditionsare met. Rules are written in the TIBCO BusinessEvents® Extreme rule language, which is similarto the Java language. Rules are declarative and are generally narrow in scope. A rule has three parts:the declaration (declare), the conditions (when), and the actions (then). As with rule functions, youcan work in a source view, which displays the Java-like code, or in a form view.

How are rules used at runtime? The rule engine checks all changes and additions to the Retenetwork and evaluates or reevaluates rules, using their declaration and conditions, as needed. Eligiblerules are added to the rule agenda.

What is the rule agenda A rule fires when it is at the top of the agenda. The engine determinesthe order of firing using rule declarations and conditions, and each rule’s priority and rank (if thesefeatures are used). As the contents of the Rete network change, the engine reevaluates rules andremoves any that are no longer eligible to fire. See Understanding Conflict Resolution and Run toCompletion Cycles in TIBCO BusinessEvents® Extreme Application Architect’s Guide fordetails.

How can you prioritize rule execution? The Priority setting on a rule is used to determine theorder in which rules are fired. Those with a number closer to one fire first. Within a set of rules thathave the same priority, a ranking feature enables you to determine which fire before others. Theranking feature uses a callback rule function that enables you to specify business logic to establishthe rank of a rule. When there is no reason to force rules to execute in a particular order, leave thePriority and Rank fields set to the default and let the runtime engine determine rule order.

How can you create concept instances? In this task you instantiate an object instance using itsontology function. Another way is using the Instance.createInstance() function. The In-stance.createInstance function uses the XSLT mapper to map any of the scope variables(such as properties, attributes and event payloads) to the new instance properties. You can alsocreate event instances in a similar way, using the Event.createEvent() function.

See Run-time Inferencing Behavior in TIBCO BusinessEvents® Extreme ApplicationArchitect’s Guide.

Add the DuplicateAccountCheck Rule1. Right click the Rules folder, and select New > Rule.

2. You see the New Rule Wizard. In the Rule name field, type DuplicateAccountCheck. In theDescription field, type Checks for an existing account with the specifiedidentifier. Click Finish.

3. In the Form tab, set the Priority field to 3. It’s a higher priority than 5, the default. You’ll set theCreateAccount rule to priority 5, so that the DuplicateAccountCheck rule always firesbefore the CreateAccount rule.

4. Expand the Declaration section as needed so you can see empty rows below the headings Termand Alias.

28

Chapter 2. Project Tutorial

Page 41: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

Each of the sections can be expanded and contracted as needed.

5. Drag the Account concept from the TIBCO BusinessEvents® Extreme Studio Explorer treeinto the first empty row in the Declarations section. You see the project path of the Accountconcept in the Term column, and account in the Alias column.

6. Similarly, drag the Create event into the next available row. Change the event alias to cre-ateevent.

Declaration The Declaration provides the scope of the rule. It lists all the entity types to be usedin the rule, and their aliases. By default the alias is set to the entity name in lower case letters.You can change it as desired.

7. In the Conditions panel, type the following:

Account.lookupByIdentifier("none", createevent.identifier) != null;

This uses the generated query function for the Account ByIdentifier key. This will returnan account with the specified identifier if the account already exists.

8. In the Actions panel, just below the Conditions panel, type these statements:

//// Indicate that account already exists//System.debugOut("WARNING: Account " + createevent.identifier + " already exists.");

//// All done// Event.consumeEvent(createevent);

These actions are done only if the conditions are met. If not, then the next rule in the agendafires — and that is the CreateAccount rule, which you’ll define next.

You are also consuming the event, so it cannot trigger any other rules.

29

Add DuplicateAccountCheck and CreateAccountRules

Page 42: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

9. Save and close the resource.

Add the CreateAccount Rule1. Right click the Rules folder again, and select New > Rule.

2. You see the New Rule Wizard. In the Rule name field, type CreateAccount.

3. Click Finish.

4. In the Form tab, set the Priority field to 5. This is a lower priority than the DuplicateAc-countCheck rule.

5. Drag the Create event from the TIBCO BusinessEvents® Extreme Studio Explorer tree intothe first empty row in the Declaration section. Change the alias name to createevent.

This rule has no conditions — the DuplicateAccountCheck rule means there is no need.You could have combined the two rules into one. There are many ways to write rules for a project.You have to use your judgment.

In the Actions panel, you’ll use an ontology function to create the Account concept instance.You access the ontology functions using the function catalog.

30

Chapter 2. Project Tutorial

Page 43: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

6. From the top menu select Window > Show View > Other > TIBCO BusinessEvents®Extreme > Catalog Functions. The Catalog Functions view displays on the right (unlessyour Eclipse IDE is configured differently — it could display along the bottom, for example).

7. Below each concept, event, and rule function is its ontology function. Expand OntologyFunctions > FraudDetection > Concepts > Account > Account.

8. Drag the Account function into the Actions section. You see its signature:

Concepts.Account.Account( /*extId String */, /*identifier String */, /*balance double */, /*status String */, /*averageMonthlyBalance double */, /*recentDebitBalance double */)

9. Update the function to create the Account concept, and type the rest of the actions as follows.You can double click the tab to expand the rule editor, to make rule writing easier.

//// Create a new account//Concepts.Account.Account( "" /* no external identifier */, createevent.identifier, createevent.balance, "Enabled" /* account is enabled by default */, createevent.averageMonthlyBalance, 0 /* no current debits" */);

System.debugOut("INFO: Created account " + createevent.identifier);

//// All done//Event.consumeEvent(createevent);

10. Save and close the resource.

31

Add DuplicateAccountCheck and CreateAccountRules

Page 44: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

Add ApplyDebit, InvalidAccount, and Check-Balance Rules

The rules you add in this section work together as follows:

When a Debit event is asserted into the Rete network, TIBCO BusinessEvents® Extreme checksrules with the Debit event in their scope.

• The ApplyDebit rule has the Debit event and the Account concept in its scope. It’s priority1 so it will execute before any other lower priority rule based on rule conditions. A query on accountidentifier is done in the ApplyDebit rule condition to try to find an account with the identifierspecified in a Debit event. If the account is found, it is asserted into the Rete network, makingit available for rule execution.

• If an Account instance whose identifier matches the identifier in the debit event is found, theApplyDebit rule executes if the account is not Disabled. The account balance is debitedand a history concept is recorded to track that a debit has occurred.

• If the Rete network does not contain a matching Account instance because the query in theApplyDebit rule condition did not find the account, then other rules in the agenda — thosethat have Debit or AccountOperations events in their scope — are eligible to execute.InvalidAccount is the only rule with the AccountOperations event in its scope, and no

32

Chapter 2. Project Tutorial

Page 45: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

account, so it is eligible and it executes. It sends a message to the console that no matchingaccount is found.

• The CheckBalance rule has an Account concept in its scope. When an account is debited theAccount concept is changed, and so the CheckBalance rule becomes newly true. The effectis similar to assertion of a new concept into the Rete Network. If the debit has made the accountbalance zero, this rule sets the status to Disabled.

It’s important to understand how conflict resolution and run to completion (RTC) cycles work. Ifyou understand what triggers rules to execute, and why a rule may not execute, you can designrules more effectively. For a reminder, carefully reread Understanding Conflict Resolution and Runto Completion Cycles in TIBCO BusinessEvents® Extreme Application Architect’s Guide.

See Run-time Inferencing Behavior in TIBCO BusinessEvents® Extreme ApplicationArchitect’s Guide.

If you have completed the section called “Add the DuplicateAccountCheck Rule” on page 28 andthe section called “Add the CreateAccount Rule” on page 30, you will be familiar with adding rules.This section shows the source code for the three rules you will add.

The main purpose for showing the form view is so you can compare it with the source view whencreating your own rule.

Example 2.1. ApplyDebit Rule Source View Code

// $Revision: 1.1.4.7 $/** * @description Debit the matching account by the specified amount. */rule Rules.ApplyDebit { attribute { priority = 1; forwardChain = true; } declare {

Events.Debit debit; Concepts.Account account; } when { Account.lookupByIdentifier("write", debit.identifier) != null; account.status != "Disabled"; Instance.isModified(account) == false; } then { // // Remove all old history objects for this account older than 2 minutes // Object results = History.lookupByAccount("read", "ascending", account.identifier, null); DateTime now = DateTime.now(); Concepts.History history = Query.next(results); Double debitSum = 0;

while (history != null) { if ((DateTime.getTimeInMillis(now) - DateTime.getTimeInMillis(history.at)) > 120000) { System.debugOut(

33

Add ApplyDebit, InvalidAccount, and CheckBalanceRules

Page 46: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

"INFO: Removing expired history for " + account.identifier + ". History amount is " + history.amount); Instance.deleteInstance(history); history = Query.next(results); continue; } debitSum = debitSum + history.amount; history = Query.next(results); }

// // Create a history object and debit the account // history = Concepts.History.History( "", debit.amount, DateTime.now(), account.identifier);

// // Update the recent debit sum for this account // account.recentDebitBalance = debitSum + debit.amount;

// // Maximum debit is current balance // long newBalance = account.balance - debit.amount; long debitAmount = debit.amount;

if (newBalance > 0) { account.balance = newBalance; } else { debitAmount = account.balance; account.balance = 0; }

System.debugOut( "INFO: Debited account " + account.identifier + " by $" + debitAmount + ". New balance is $" + account.balance); }}

34

Chapter 2. Project Tutorial

Page 47: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

Example 2.2. InvalidAccount Rule Source View Code

// $Revision: 1.1.4.4 $/** * @description Reports account not found message for debit */rule Rules.InvalidAccount { attribute { priority = 10; forwardChain = true; } declare {

Events.AccountOperations accountoperations; } when { Account.lookupByIdentifier("none", accountoperations.identifier) == null; } then { System.debugOut("WARNING: Account " + accountoperations.identifier + " not found.");

// // All done // Event.consumeEvent(accountoperations); }}

35

Add ApplyDebit, InvalidAccount, and CheckBalanceRules

Page 48: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

Example 2.3. CheckBalance Rule Source View Code// $Revision: 1.1.4.3 $/** * @description Disable an account with zero balance. */rule Rules.CheckBalance { attribute { priority = 4; forwardChain = true; } declare { Events.Debit debitevent; Concepts.Account account; } when { account.balance == 0; account.status != "Disabled"; } then { // // Disable the account // account.status = "Disabled";

System.debugOut("WARNING: " + account.identifier + " account balance is zero."); }}

Add the FraudDetection, EnableAccount, andDisabledAccount Rule

You are an experienced rule builder now!

How are conditions processed? All conditions in a rule must be met, before the action is done.That is, each condition is joined by an implied AND operator.

In what order are conditions evaluated? To learn more about the effect of filters, equivalentjoin conditions, and non-equivalent join conditions on the efficiency of a rule, see Order of Evaluationof Rule Conditions in TIBCO BusinessEvents® Extreme Application Architect’s Guide. Un-derstanding these points helps you design an efficient project.

How can I learn about all these catalog functions? TIBCO BusinessEvents® Extreme provideshundreds of catalog functions for use in rules and rule functions. You can use functions you alreadyknow about by typing the beginning of the name and then using the completion hints that appear.To learn about more functions, you can open the Catalog Functions view and browse. To see thetooltip for a function, hover the mouse over the function name. You can then drag a function intothe editor, as you did in the section called “Add the CreateAccount Rule” on page 30. As a reminder,here’s how to open the Catalog Functions view: Window > Show View > Other > TIBCOBusinessEvents® Extreme > Catalog Functions.

36

Chapter 2. Project Tutorial

Page 49: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

See Run-time Inferencing Behavior in TIBCO BusinessEvents® Extreme ApplicationArchitect’s Guide.

Add the FraudDetection RuleAdd the FraudDetection rule, typing in the Source view or Form view, according to your prefer-ence. The source is shown below.

Most of the code is in the conditions. The first condition checks whether the account is Disabledalready.

The first part of the second condition determines if the maximum number of debits was exceeded.

The second part of the second condition checks whether the sum of all debits in the verificationinterval is greater than the specified percentage of the account average monthly balance. The averagemonthly balance, for the purposes of this tutorial, is set in the Account instance created by theCreateAccount rule.

Example 2.4. FraudDetection Rule Source

// $Revision: 1.1.4.6 $/** * @description Fraud detection ruile. * @author appliance */rule Rules.FraudDetection { attribute { priority = 5; forwardChain = true; } declare {

Events.Debit debitevent; Concepts.Account account; } when { account.status != "Disabled";

// // Possible fraud if number of debits > 3 // (History.cardinalityByAccount(account.identifier, null) > 3) ||

// // Or recent debits > 80% of average monthly balance // ((account.recentDebitBalance != 0) && (((account.recentDebitBalance / account.averageMonthlyBalance) * 100) > 80));

} then { // // Disable the account // account.status = "Disabled";

System.debugOut( "WARNING: Fraud suspected on account " + account.identifier + ".\n\tNumber of debits within 2 minutes " + History.cardinalityByAccount(account.identifier, null)

37

Add the FraudDetection, EnableAccount, and Dis-abledAccount Rule

Page 50: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

+ ".\n\t% of average monthly balance debited within 2 minutes " + (account.recentDebitBalance / account.averageMonthlyBalance) * 100 + "."); }}

Add the EnableAccount RuleAdd the EnableAccount rule. This rule allows you to change an Account status from Disabledto Enabled at run-time.

Example 2.5. EnableAccount Rule Source

// $Revision: 1.1.4.4 $/** * @description Re-enable a disabled account. */rule Rules.EnableAccount { attribute { priority = 1; forwardChain = true; } declare { Events.Enable enableevent; Concepts.Account account; } when { Account.lookupByIdentifier("write", enableevent.identifier) != null; account.status == "Disabled"; } then { // // Re-enable the account and reset the balance and history // account.status = "Enabled"; account.balance = enableevent.balance; account.recentDebitBalance = 0; Object results = History.lookupByAccount("read", "ascending", account.identifier, null); Concepts.History history = Query.next(results);

while (history != null) { Instance.deleteInstance(history); history = Query.next(results); }

System.debugOut("INFO: Account " + enableevent.identifier + " re-enabled, balance set to " + account.balance + ".");

// // All done // Event.consumeEvent(enableevent); }}

38

Chapter 2. Project Tutorial

Page 51: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

Add the DisabledAccount RuleAdd the DisabledAccount rule . This rule allows just reports that an account is disabled to theconsole.

Example 2.6. DisabledAccount Rule Source

// $Revision: 1.1.4.2 $/** * @description Reporting warning on disabled accounts */rule Rules.DisabledAccount { attribute { priority = 9; forwardChain = true; } declare {

Events.Debit debit; Concepts.Account account; } when { Account.lookupByIdentifier("none", debit.identifier) != null; account.status == "Disabled"; } then { System.debugOut("WARNING: Account " + account.identifier + " disabled.");

// // All done // Event.consumeEvent(debit); }}

Summary and Next StepsCongratulations! You have now configured the project’s ontology and rules. Now you are ready toconfigure the Cluster Deployment Descriptor and build the archive for deployment. But before youdo, it’s wise to validate and analyze the project, and look at it in the Project diagram.

Analyze and Validate the ProjectIn this task, you check the project for errors. If you have configured it correctly, you’ll see warningsbut no errors. Warnings indicate potential issues, such as absence of default events. It’s alwaysworth checking them. In the FraudDetection project, the warnings do not indicate any actualissues.

How can I validate that there are no basic errors in my code? To perform checks that do nottake project logic into account, use Project > Validate Project (or right-click on a project name, anduse the same named option).

What if there are problems in my code? You can debug it. TIBCO BusinessEvents® Extremebuilds on the Eclipse debugger features to provide additional checks. Developers familiar with theEclipse debugger will find it intuitive to use.

39

Analyze and Validate the Project

Page 52: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

How can I analyze that the logic of my project is OK? For this kind of checking you use ProjectAnalyzer or the Element Diagram or both. They work together to provide insights into your project.Project Analyzer is a document generated in the Problems view area. Element Diagram provides avisualization of the whole project or of selected project elements. It also shows all dependencies ina project. Project Analyzer and Element Diagram can be configured to run separately or together,using preferences.

How can I change the names of project resources, or move them around? Use the refactoringfeatures. They ensure that changes you make are reflected throughout the project (with certainlimitations).

In TIBCO BusinessEvents® Extreme Application Developer’s Guide, see thesesections:

• Element Refactoring Operations

• Testing and Debugging Projects

• Diagrams, especially Project Analyzer and Selected Entity Project Diagrams

Analyze and Validate the Project1. In TIBCO BusinessEvents® Extreme Studio Explorer, highlight the project name, then from the

top menus select Project > View. You see the project visualization in the main editor window.

40

Chapter 2. Project Tutorial

Page 53: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

You can see the dependencies and relationships between the project resources. You can jumpto a resource editor by clicking the resource’s icon. You can use the Project Filter palette whichappears to the right of the diagram to show selected types of items only.

2. Click the Problems tab to see the project analysis.

The Type columns shows the type of check that resulted in the warning. You can sort by anycolumn. Here are some warnings about actions taken during project development. They aresorted by Resource and some columns are sized smaller to make others more visible.

3. Close the FraudDetection.projectview tab. Diagrams are not saved. They are generatedwhen needed.

Summary and Next StepsNow you are ready to configure the Cluster Deployment Descriptor (CDD) and build the archivefor deployment.

Add a Cluster Deployment Descriptor andBuild the EAR File

To deploy a project you need a CDD file and an EAR file. The CDD is not included in the project'sEAR. This means you can reconfigure a project’s deployment configuration without having to rebuildthe EAR.

What is an EAR? The Enterprise Archive or EAR file contains details for all the resources in aproject, and project global variables. It also contains any Java code that was added to the project.

What is a CDD? The project’s deployment configuration is defined in an XML file called the ClusterDeployment Descriptor, or CDD. You edit this file using the TIBCO BusinessEvents® ExtremeStudio Cluster Deployment Descriptor editor.

How do I set up preprocessors and startup and shutdown rule functions? The CDD iswhere you configure rule functions to act as event preprocessors, startup rule functions, or shutdownrule functions. Only rule functions whose Validity setting is Action are valid for these uses.(These rule functions cannot require anything to be in their scope, because they execute outsideof the context of the Rete network and TIBCO BusinessEvents® Extreme project resources.) Apreprocessor is associated with a destination. It processes events arriving at that destination.

What is an inference agent? An agent does certain work within a JVM. Inference agents listenfor messages arriving at destinations, and transform them into events. The events trigger rules,using the agent’s Rete network and forward chaining, and the inference agent executes the rules.

41

Add a Cluster Deployment Descriptor and Build theEAR File

Page 54: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

In TIBCO BusinessEvents® Extreme Application Developer’s Guide, see thesechapters:

• Cluster Deployment Descriptor (CDD)

• Agent and Processing Unit Configuration

Add and Configure a CDD1. In TIBCO BusinessEvents® Extreme Studio Explorer, right click the project name, FraudDe-tection, and select New > Cluster Deployment Descriptor. You see the New ClusterConfiguration Wizard.

You can create multiple CDD files for a project and at deploy time use the one that has the con-figuration you want to use.

2. In the File name field, type FraudDetection and click Next.

Unlike other project resources, you can change the name later as desired.

3. In the Object Management dialog, select Cache from the Object Management Type drop-downlist. Then click Finish. The cluster configuration page appears.

4. Click the Collections tab, and do the following:

a. Select Input Destinations and click Add.

b. In the Input Destinations Collection field, type HTTP and again click Add.

c. In the Select Input Destinations dialog, select /Channels/HTTP/AllOperations andclick OK. A Configuration panel appears.

d. In the Input Destination ID field, edit the identifier to read AllOperations.

e. In the Preprocessor field, select /RuleFunctions/PreProcessor and then click OK.

Now this preprocessor will act on events arriving at the AllOperations destination.

The Configuration panel looks like this:

42

Chapter 2. Project Tutorial

Page 55: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

Collections enable you to create resources you can reuse when configuring multiple agent classes.Collections are used here to demonstrate the feature. In simple projects, you could simply con-figure the agent class without using collections.

5. Select the Agent Classes tab to display the default agent class, which is called inference-class.

When configuring an agent class, you can select a subset of the project rules, select and configuredestinations, and select startup and shutdown rule functions. Thus different agent classes canbehave quite differently at runtime.

6. Select inference-class.

43

Add a Cluster Deployment Descriptor and Build theEAR File

Page 56: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

7. Check the Enable Concurrent RTC check box.

8. Select Input Destination Collections and click Add. You see the Select Input Destinations dialog.In the Reference Collections area, select HTTP and click OK.

44

Chapter 2. Project Tutorial

Page 57: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

As mentioned above, you can configure input destinations here, or link to input destinationsconfigured in the Collections tab—or use both methods. Here we reference the collection youalready defined.

9. Save and close the CDD.

Build the EAR File1. In TIBCO BusinessEvents® Extreme Studio Explorer, highlight the project name, then from the

top menu select Project > Build Enterprise Archive.

If you see a message asking you to save all project resources, click Yes. It means an unsavedresource editor is open.

2. In the File Location field, browse to and select the directory above the project directory.

3. Click Save.

4. Click Apply, then click OK. You see messages as the EAR file builds, then you see a messagethat the EAR file has built correctly:

45

Add a Cluster Deployment Descriptor and Build theEAR File

Page 58: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

Summary and Next StepsCongratulations! You are ready to deploy the FraudDetection project.

The next chapter discusses how to start server nodes to host the FraudDetection project andhow to deploy the project to the nodes. It then provides details on injecting events into the deployedproject to execute the rules you built.

46

Chapter 2. Project Tutorial

Page 59: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

3Deployment

This chapter describes how to start TIBCO BusinessEvents® Extreme nodes and how to deployan application to those nodes. It also provides information on how to generate events to execute thedeployed application.

Starting NodesTo start a TIBCO BusinessEvents® Extreme node in which to deploy an application, complete thesesteps:

1. Log into a command line shell.

2. Export SW_HOME into the environment. SW_HOME must be set to TIBCO_HOME/be-x/<ver-sion>. For example:

export SW_HOME=/opt/tibco/be-x/1.0.1

3. Update the PATH variable to include TIBCO_HOME/be-x/<version>/dis-trib/kabira/bin. For example:

export PATH=/opt/tibco/be-x/1.0.1/distrib/kabira/bin:$PATH

4. On each machine that will run a TIBCO BusinessEvents® Extreme node, use the administrat-or client to install a node.

Example 3.1. Installing a node

administrator install node

Installing application tibco/be-x on node appliance...

Starting node appliance ... Installing Registry ... Updating Registry ...

47

Page 60: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

Installing Components ... Starting Components ... Waiting for security services to start ... Loading Security Policy ... Startup complete

Node appliance is configured to use PRODUCTION executables Node appliance shared memory size is 512Mb Node appliance path: /home/guest/nodes/appliance Node appliance host: appliance

System Coordinator Host: All Interfaces System Coordinator Port: 31799

Installing components for application tibco/be-x

Administration Port: 31799 Service Name: "None" Node Name: "appliance"

This initializes the node.

5. After the node is installed, start the node using administrator start node. The startnode command requires the administration port displayed when a node is installed.

Example 3.2. Starting a node

administrator adminport=31799 start node Waiting for application to start . Components started Loading configurations Auditing security configuration Host: localhost Administration Port: 31799 Service Name: "None" Node Name: "appliance"

The node is now ready for the FraudDetection application to be deployed.

Deploying the ApplicationComplete these steps to deploy the fraud detection application.

1. Run the deploy tool (deploy.jar) to deploy a TIBCO BusinessEvents® Extreme applicationinto a JVM. The command line to do this is:

java - jar <installation path>/deploy.jar hostname=<host name> \ adminport=<node administration port> \ username=<administrator name> \ password=<administrator password> \ <path to EAR> \ descriptor=<path to CDD> \ processingunit=<processing unit name> \

where:

• installation path - Specifies the TIBCO BusinessEvents® Extreme installation path(TIBCO_HOME/be-x/<bex-version>/sdk).

• hostname - Specifies the machine name on which the node is running. Defaults to localhost.

48

Chapter 3. Deployment

Page 61: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

• adminport - Node administration port. Displayed when node is started.

• username - Administrator user name.

• password - Administrator password.

• path to EAR - Location of the TIBCO BusinessEvents® Extreme Enterprise ApplicationArchive being deployed.

• descriptor path to CDD - The path to the Cluster Deployment Descriptor (CDD) for theapplication being deployed

• processingunit - Optional name of processing unit if the default processing unit is notused.

Information on all of the deployment tool parameters are documented in the TIBCOBusinessEvents® Extreme Java Developer's Guide.

Example 3.3 on page 49 shows the output when deploying the FraudDetection application. Theoutput has been edited for space.

Example 3.3. Deploying the applicationjava -jar deploy.jar hostname=kabira-server.local adminport=2001 username=guest password=guest FraudDetection.ear descriptor=fd.cdd DEBUG: Connecting to [kabira-server.local:2001] ...INFO: Deploying TIBCO BusinesEvents Extreme(R) Application [FraudDetection.ear]INFO: deploy.jar version: [TIBCO BusinessEvents(R) Extreme 1.1.0 (build 120608)] starting at [Sat Jun 16 06:54:16 PDT 2012]INFO: JVM remote debugger agent running on [kabira-server.local:47566] ...INFO: node version: [TIBCO BusinessEvents(R) Extreme 1.1.0 (build 120608)]INFO: Starting application [com.tibco.cep.container.standalone.BEMain] ...INFO: Component [com.tibco.cep.container.standalone.BEMain] started on JVM [com_tibco_cep_container_standalone_BEMain3].Listening for transport dt_socket at address: 47566INFO: JMX Management Service started at: kabira-server:2099 172.16.208.139:2099 service:jmx:rmi:///jndi/rmi://kabira-server:2099/jmxrmiUsing property file: be-engine.tra

**************************************************************************** TIBCO BusinessEvents 5.1.0.115 (2012-05-24) Using arguments :-c deploy/resources/deploy-1339854856165/fd.cdd deploy/resources/deploy-1339854856165/FraudDetection.ear Copyright 2004-2012 TIBCO Software Inc. All rights reserved.

****************************************************************************2012 Jun 16 06:54:30:946 GMT -7 kabira-server Info [main] - [container.standalone] **************************************************************************** TIBCO BusinessEvents 5.1.0.115 (2012-05-24) Using arguments :-c deploy/resources/deploy-1339854856165/fd.cdd deploy/resources/deploy-1339854856165/FraudDetection.ear Copyright 2004-2012 TIBCO Software Inc. All rights reserved.

****************************************************************************

...

2012 Jun 16 06:54:51:368 GMT -7 kabira-server Info [main] - [runtime.service] [inference-class] Starting AgentTimeManager for session: inference-class

49

Deploying the Application

Page 62: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

2012 Jun 16 06:54:51:422 GMT -7 kabira-server Info [main] - [runtime.service] Agent inference-class-0: Starting Channels2012 Jun 16 06:54:51:427 GMT -7 kabira-server Info [main] - [driver.http] Started Channel [/Channels/HTTP]2012 Jun 16 06:54:51:428 GMT -7 kabira-server Info [main] - [runtime.service] Agent inference-class-0: Activating Event Subscriber2012 Jun 16 06:54:51:442 GMT -7 kabira-server Info [main] - [runtime.service] Agent inference-class - 0: Activated2012 Jun 16 06:54:51:444 GMT -7 kabira-server Info [main] - [runtime.service] Started [DefaultAgentManager]2012 Jun 16 06:54:51:449 GMT -7 kabira-server Info [AgentMgr.Thread.1] - [runtime.service]

Currently known [inference-class] agents = 1 Member: ac10d08b-c356, Agent name: inference-class, Agent id: 0, Agent priority: 10, Status: INITIALIZED

2012 Jun 16 06:54:51:455 GMT -7 kabira-server Info [AgentMgr.Thread.1] - [runtime.service]

Currently known [inference-class] agents = 1 Member: ac10d08b-c356, Agent name: inference-class, Agent id: 0, Agent priority: 10, Status: PREPARETOACTIVATE

2012 Jun 16 06:54:51:459 GMT -7 kabira-server Info [AgentMgr.Thread.1] - [runtime.service]

Currently known [inference-class] agents = 1 Member: ac10d08b-c356, Agent name: inference-class, Agent id: 0, Agent priority: 10, Status: ACTIVATED

2012 Jun 16 06:54:51:481 GMT -7 kabira-server Info [main] - [studio.core] Hot Deployment disabled2012 Jun 16 06:54:51:587 GMT -7 kabira-server Info [main] - [runtime.service] Registering all BE-Engine level Group MBeans...2012 Jun 16 06:54:51:591 GMT -7 kabira-server Info [main] - [runtime.service] All BE-Engine level Group MBeans SUCCESSFULLY registered2012 Jun 16 06:54:51:591 GMT -7 kabira-server Info [main] - [runtime.session] BE Engine kabira-server started2012 Jun 16 06:54:53:366 GMT -7 kabira-server Info [HTTP-Channel-Startup] - [driver.http] Channel server for HTTP Channel[Port:8108] starting2012 Jun 16 06:54:57:530 GMT -7 kabira-server Info [HTTP-Channel-Startup] - [driver.http] Channel server for HTTP Channel[Port:8108] successfully started

Sending EventsNow that we have deployed the application to the nodes we need to inject some events to triggerthe rules we designed. Events are generated from a Web page in a browser. To start sending events,open up the readme.html file shipped with the FraudDetection example in a browser. Thereadme.html file is found in <installation directory>sdk/examples/frauddetec-tion. This will display a screen like:

50

Chapter 3. Deployment

Page 63: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

There are these forms on this web page:

• Node Address - set the host name and port number where the TIBCO BusinessEvents® Extremenode is running.

• /Events/Create - send a create event.

• /Events/Debit - send a debit event.

• /Events/Enable - send an enable event.

Sending an enable event for an account that is not disabled is quietly discarded with noaction.

CongratulationsYou have successfully completed the design and deployment of your first TIBCO BusinessEvents®Extreme application.

51

Congratulations

Page 64: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

52

Page 65: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

IndexAAccount

key, 24properties, 23

applicationdeployment, 48

CCDD, 42

agent class, 43concurrent RTC, 43input destination, 42object management type, 42

channeldestination, 14HTTP, 12shared resources, 13

Cluster Deployment Descriptor (see CDD)concept

Account, 23History, 22

Ddeploy.jar, 48deployment tool, 48

Eevent

AccountOperations, 17Create, 18Debit, 19Enable, 20

HHistory

key, 22properties, 22

Nnode

installation, 47start, 48

PPATH, 47Preprocessor, 25project

creation, 8

import, 8problems, 41view, 40

Rreadme.html, 50Rule

ApplyDebit, 33CheckBalance, 36CreateAccount, 30DisabledAccount, 39DuplicateAccountCheck, 28EnableAccount, 38FraudDetection, 37InvalidAccount, 35

Rule FunctionPreprocessor, 25

Ssending events

readme.html, 50SW_HOME, 47

53

Page 66: TIBCO BusinessEvents® Extreme · 2015. 6. 28. · 1 Introduction This brief chapter pr ovides an over view of the tutorials and the tutorial scenario used in this guide. Overview

54


Recommended