Professional Documents
Culture Documents
AGENDA
Introduction to CEP & Business Events Business Events Palette Overview Channels & Destinations Events Concepts Rules & Rule Sets Scorecards
HAS
Situation awareness Sense and respond Track and trace
SITUATION AWARENESS
KNOWING the state of product, person, document or entity of interest at any particular time Requires continuous MONITORING of events EXAMPLE The REAL TIME DASHBOARD indicates all the performance indicators for a runtime production process.
EXAMPLE Tracking events from an RFID-enabled inventory control system where at any point in time you need to know the status of the delivery of goods at a particular location
Project Files
STATE MODELER
EAR File
Browser
Describes INPUTS in BE
Describes DATA in BE
AGENDA
Introduction to CEP & Business Events Business Events Palette Overview Channels & Destinations Events Concepts Rules & Rule Sets Scorecards
AGENDA
Introduction to CEP & Business Events Business Events Palette Overview Channels & Destinations Events Concepts Rules & Rule Sets Scorecards
DESTINATIONS
CHANNEL
MESSAGES
Destination orders
map to
Default Event
new_order
TIBCO EMS
Deserialization
Subject: credit
Event
credit_timeout
TYPES OF CHANNELS
JMS Channels
Local Channels
AGENDA
Introduction to CEP & Business Events Business Events Palette Overview Channels & Destinations Events Concepts Rules & Rule Sets Scorecards Example
WHAT IS AN EVENT?
ACTIVITY that happens. EXAMPLE: Kicking a ball.
Instance
In Complex Event processing the term Event is overloaded. It means the definition of object that represents the activity (Event type) and also an Instance of that event type.
Business Events
External Environment
Explicit
2) Memory Acknowledgement Depending upon the object management type BusinessEvents acknowledges the message. Some messages do not require acknowledgement. e.g.: Reliable Rendezvous messages.
TYPES OF EVENTS
SIMPLE EVENT
Life of an Event Time To Live (TTL)
Event Expired!
After completion of first RTC Cycle. After specified time period has elapsed. Does not expired. Must be explicitly consumed.
Expiry Action -Any Action(s) possible to define in Rule language, to take when a simple event expires. -Expiry actions can be inherited from events parent. -If an event is explicitly consumed in the rule, BusinessEvents does not execute the expiry action.
SIMPLE EVENT
Event Inheritance/Inherits from
Parent Event can NOT have payload.
Expiry Actions set in child Event overrides the parent event Expiry Actions.
Extended Properties are used internally & it is reserved for future release.
TYPES OF EVENTS
TIME EVENTS
TIMERS, that are used to trigger rules.
Repeat Every -Creates a new time event after every specified time interval. -Creates specified number of events at each time interval.
Rule Based
-ScheduleTimeEventName() function is used
TYPES OF EVENTS
ADVISORY EVENTS
Advisory Events are asserted into the memory when certain conditions occur. It has attributes for category, type & message. Exception
Category: Exception Type: Exception class name Message: Message in class.
AGENDA
Introduction to CEP & Business Events Business Events Palette Overview Channels & Destinations Events Concepts Rules & Rule Sets Scorecards
CONCEPTS
Working Memory
Depar tment Car Pen
-Concepts are automatically asserted into working memory when created, except when concepts are returned by Database query & in the context of in-process integration.
Insert.createInstance() Insert.deleteInstance()
CONCEPTS
Historical Values for a concept property are kept in a ring buffer.
CONCEPTS
History Policy
000362510100
CONCEPT RELATIONSHIP
CONCEPT RELATIONSHIP
Refers
Wheel
Diameter Vendor Rim Type Material
Customer
CustomerID OrderID OrderDetails
Car
Color Vendor Make Model Engine Wheel:Contains
Inherits
Bike Wheel
----- -----------
Contains
Car Wheel
---------------
Car
Car Wheel
Motorbike
AGENDA
Introduction to CEP & Business Events Business Events Palette Overview Channels & Destinations Events Concepts Rules & Rule Sets Scorecards
RULES
A Rule includes a declaration of entity types, one or more separate conditions , which evaluate to true or false, and an action, which is eligible to execute only when ALL the conditions evaluate to true
RULE
+ Conditions +
Actions
Rule Priority
A TYPICAL RULE
RULE SETS
A rule set is a container for rules. All rules exist within a rule set. Grouping rules into rule sets enables you to deploy a selection of rule sets in a Business Events Archive (BAR).
EXAMPLE : As seen in the picture, different colored pebbles are contained by different mesh bags. So mesh bag becomes the rule set that contains pebbles which are the rules.
RULE FUNCTIONS
Start Up Functions
Mainly 4 functions
types
of
rule
Virtual Functions
AGENDA
Introduction to CEP & Business Events Business Events Palette Overview Channels & Destinations Events Concepts Rules & Rule Sets Scorecards
SCORECARDS
Serves as a static variable which is available throughout the project. Unlike concepts and events, each scorecard resource is itself a single instance. Use a scorecard resource to track Key Performance Indicators (KPI) or any other information.
AGENDA
State Modeler Database Concepts Out & In Process Integration
STATE MODELER
UML-compliant application.
Initiation
STATE MODEL
Each State model begins with start state and ends with one or more end states . Between these states may be simple, composite and concurrent states connected by transitions.
one
At most one
State Machine
STATES
START
Entry Action
Exit Action
END SIMPLE
Exit Action
Entry Action
COMPOSITE STATE
Composite States are like nested folders. Composite States can contain simple states, other composite states and concurrent states. Credit Check (Composite State) Fulfillment Process
COMPOSITE STATE
Composite States are like nested folders. Composite States can contain simple states, other composite states and concurrent states. Credit Check (Composite State) Fulfillment Process
State1
State2 FAILED
CONCURRENT STATE
Allows multiple state flows to operate at one time. A state machine cannot exit a concurrent state until all its region have finished processing. Can contain composite , simple states.
AGENDA
State Modeler Database Concepts Out & In Process Integration
DATABASE CONCEPTS
Database Concepts enable you to manipulate the database using a rule or rule function. Business Events
Tables
Insert Update Delete Query
DB Import Utility
Views
DB Concept
AGENDA
State Modeler Database Concepts Out & In Process Integration
Enables you to send and receive Business Events events in an Active Matrix Business Works engine. Both engines run in separate JVMs.
JMS/RV channel
Enables you to integrate ActiveMatrix BusinessWorks and Business Events functionality in one JVM. Enables each product to take advantage of the strengths of the other product. ActiveMatrix BusinessWorks can use Business Events as a light-weight rules engine. BusinessEvents can use transports available in ActiveMatrix BusinessWorks.
JVM
ActiveMatri Business x Business Events Works
BusinessWorks.cancelProcess() -- Cancels the specified BusinessWorks process. -- Useful for canceling a long running job .
BusinessWorks.shutdown() (Optional)
AGENDA
Introduction to Object Management And Fault Tolerance In Memory Object Management Persistence Object Management Cache Object Management
OBJECT MANAGEMENT
OM is used to manage the state of Ontology objects (concepts, state machines, scorecards, simple events and time events) that are created and used by each Rete network.
Three main Options for Object Management
In Memory
Persistence Cache
FAULT TOLERANCE
Fault tolerance mechanism differs with each of the OM options.
In Memory FT is provided at the engine level. Configuration uses various engine properties to define primary and secondary engines.
Persistence Fault tolerance requires a custom solution. Cache FT is provided at the inference agent level. With multi-engine features enabled, fault tolerance and load balancing are provided by the same set of features.
OVERVIEW
Default option
Clustered : The ability to maintain multiple copies of each object in different nodes such that if one node fails, another node can take over.
AGENDA
Introduction to Object Management In Memory Object Management Persistence Object Management Cache Object Management
Rete n/w
Rete n/w
Primar y server
FT
BusinessEvents offers priority-based fault tolerance to provide high availability of the BusinessEvents engine process. Fault tolerance provides transitioning between inactive and active states. If two servers have the same priority setting, then the server that joined the group first takes priority in determining the failover and failback order.
Rete n/w
Rete n/w
Primar y server
FT
FT
FT Cache
Rete n/w
FT
FT
FT Cache
Open the BE_HOME\bin\be-engine.tra file in text editor. Configure following properties with same values for all engines. Engine.FT.UseFT true Engine.FT.GroupName group name In each engine property file provide the unique engine name be.ft.nodename
Configure the weight properties to define priorities among servers. Secondary Servers will have lowest priorities. Engine.FT.Weight integer
AGENDA
Introduction to Object Management Memory Object Management Persistence Object Management Cache Object Management
The PERSISTENCE object management option persists a snapshot of the working memory for each inference agent in the deployed system. Data for each inference agent is persisted to a data store at specified intervals.
Provides data recovery in the case of a complete system failure. When system comes up, BE restores the working memory to the last check point state.
Affects performance due to disk writes required. Fault Tolerance features are not provided by BusinessEvents. Parameters such as checkpoint interval and property cache size helps us to tune performance. Can also determine how many objects to keep in the data cache, in order to manage JVM memory usage for the application for better performance.
A checkpoint is the point in time at which the working memory data is written to disk. Database operations include time, creations, updates, and deletions. The checkpoint interval is theobject in seconds, between writes to disk. Outstanding database operation is one that is held in working memory only. It has not yet been written to the disk. Defines the maximum number of concept ops exceeds that of the numberJVM memorycheckpoint occurs When the number of outstanding DB properties that are kept in the specified, a for this rule session. When the persistence layer performs cleanup, the least recently used(LRU) properties are moved to the When objects are retracted(deleted) from the memory, they are marked with a retraction flag. persistence store, to reduce the number of properties in memory to the specified number. You can delete these objects from the persistence DB, or you can leave them in the DB. Recommended that you delete these retracted objects to avoid accumulating large numbers of Uncheck this field toobjects in DB, but you can keep them for from mining purposes. shutdown. retracted use the persistence database to recover data unplanned system Performance INCREASES, but data is lost in event of SYSTEM FAILURE. DEFAULT PATHS where PERSISTENCE FILES are stored BE_HOME/db/session_name : TIBCO Administrator working_directory/db/session_name : BE Engine
DATABASE OPERATIONS
AGENDA
Introduction to Object Management Memory Object Management persistence Object Management Cache Object Management
Inference Agent
Rete n/w
Cache Server a 1 b c
Cache Server 2 d e
Inference Agent
Rete n/w
Cache Server a 1 b c
Cache Server 2 d e
Event z
Inference Agent 1
Inference Agent 2
Rete n/w
Inference Agent 3
Rete n/w
Rete n/w
Cache Server a 1 b c
Cache Server 2 d e
Event z
Inference Agent 1
Inference Agent 2
Rete n/w
Inference Agent 3
Rete n/w
Rete n/w
Cache Server a 1 b c
Cache Server 2 d e
Event z
Inference Agent 1
Inference Agent 2
Inference Agent 3
Rete n/w
Rete n/w
AGENDA
Understanding Run to Completion (RTC) Cycle & Conflict Resolution Startup & Shutdown Rule Functions Event Preprocessor Rule functions Virtual Rule Functions Rule Analyzer & Debugger Rule Profiler
RTC ends
Begins when an external action causes changes to working memory One RTC cycle ends when there are no more rule actions to execute as a result of that initial change. This is also known as forward chaining, or inferencing. During one RTC no new external actions can affect the working memory. An RTC is composed of one or more conflict resolution cycles.
When a message arrives at a destination, the working memory changes. First conflict resolution cycle begins.
Business Events examines all rules that are newly true because of the change to working memory and compares them with rule dependencies. The agendas entries are ordered according to rule priority and other criteria.
Business Events executes the first rule on the agenda and removes it from the agenda
The rule action does not change working memory and Business Events executes the next rule entry in the agenda (if there is one).
OR
The rule action does change working memory and Business Events refreshes the rule action agenda to account for the changes.
Rules that have become newly true are added to the agenda.
OR
Rules that have become false are dropped from the agenda.
OR
Rules that were newly true at the last conflict resolution cycle and are still true remain in the agenda.
RTC ends
At some point, no more actions remain to be executed. The conflict resolution has run to completion.
Events are sent to destinations. Cache OM: Changes are saved to the cache and written to the backing store. Cache OM, cache-only cache mode: At the end of the RTC, all cache-only objects are removed from working memory. Persistence OM: One transaction is completed and saves changes (enabling rollback in case of failures). Profiler: profiler data is updated.
A rule is newly true if it has become true due to a change in working memory. A rule that was already true can also become newly true. A rule remains newly true until it is executed or it is removed from the agenda, or the RTC ends.
ALREADY TRUE
Before any data enters into the system, BE builds a Rete Network, which has all the rule dependencies, using the rule conditions. All dependencies in a rule are called its dependency set, which is the only thing needed to determine the truth of all the conditions.
customer.name == James;
DEPENDENCY SET
Business Events tests each rules dependency set against new set of facts. If facts match the rule dependencies, the rule action is added to the rule action agenda
FILTERS
Conditions involving two or more scope elements other than equivalent joins
3
AGENDA
Understanding Run to Completion (RTC) Cycle & Conflict Resolution Startup & Shutdown Rule Functions Event Preprocessor Rule functions Virtual Rule Functions Rule Analyzer & Debugger Rule Profiler
Configured to execute during normal system startup and shutdown. Used to initialize the system & perform more expensive operations so that the system is more efficient at runtime.
TAKE NO ARGUMENT
VALIDITY ACTION