Skip to main content

TIBCO BusinessEvents 5.x : Run to Completion (RTC) Cycle and Conflict Resolution Cycle (CRC)

TIBCO BusinessEvents (BE) utilizes, Run to Completion Cycle (RTC Cycle) and Conflict Resolution Cycle (CRC). RTC and CRC do play very significant role in designing the Complex Event Processing (CEP) Solution while using TIBCO BusinessEvents as a developing tool. Therefore it is very much important to learn about the RTC Cycle and CRC Cycle.

RTC and CRC utilizes a runtime environment, Rete Network, to hold all the rules, triggers and relationships. Rete Network is based on Rete Algorithm therefore it provides the basic property of Inference to the RTC in TIBCO BusinessEvents Engine.

Here, one very important property of RTC and CRC to understand is that,

"CRC is initiated wherever there is any change in Rete Network cause by external actions when the change is asserted to the Working Memory of the Engine, after which an RTC is initiated. RTC ends when Rule Agenda is Empty or no other rule action needed to be executed. This is called Inferencing or Forward Chaining. One RTC can have multiple CRCs."

Now lets understand what that statement implies.


Since there are 'Events' (that is detection logic format described on the 'Destination' defined in the 'Channel') that is triggered if there is any message on the respective destination. Detection of message on the destination results in changes to the runtime environment, that is a Rete Network, hence, first CRC is initiated. CRC results in the output of relevant rules that need to be triggered and arrange them based on their priorities or ranks. First RTC is inititated. Thereafter, high priority rule or highly ranked rule's action is executed first.

Afterwards there can be two possible scenarios due to the execution of  high priority rule or highly ranked rule:
Case 1: There is a change in Rete Network Again i.e. newly created concept(s) or event(s) is/are asserted in Working Memory .
Case 2 : There is a no change in Rete Network Again i.e. no newly created concept(s) or event(s) is/are asserted in Working Memory.

In Case 1, The Rule Agenda is reformed and the RTC continues which will or will not lead to multiple CRCs while in Case 2, Next rule in the priority or rank is executed and rule agenda is not reformed. Hence, First RTC is terminated and seond RTC starts. This cycle continues until rule Agenda is empty.

There are various types of agents in TIBCO BusinessEvents Agents (about which ,we will discuss later in detail in another article) but particularly, Inference Agent is responsible to implement the Rete Algorithm and initiate RTC Cycle.

RTC consist of 3 phases of Information Processing (that are represented in the following figure).

  • Phase 1 - Pre RTC Cycle
    • This phase is optional.
    • In this cycle, we process the information and if there is any irregularities present in the input data, we either try to discard the request or modify accordingly in order to make our Phase 2 of RTC a more efficient process.
    • Generally, this phase of RTC is used for either Data Preprocessing Actions or for defining 'On Engine Startup' Actions.
    • It is a multi-threaded in nature which implies that multiple Pre RTC process can be executed in parallel i.e multiple input message can be processed simultaneously.
    • After this phase, if the event still persists in the working memory (i.e. if more processing required for the input message), information or the request are allowed to enter in the Phase 2 of entire RTC Cycle otherwise gets consumed.
  • Phase 2 - RTC Cycle
    • In this cycle, action plan defined for the defined set of input message is executed.
  • Phase 3 - Post RTC Cycle
    • In this cycle, there are four operations that takes place, which we will discuss in detail in another article.
      1. Entity Object are updated in In-Memory i.e. all Cache Only object are removed from In-Memory
      2. Profiler Matrices are updated
      3. Object Management take place i.e. Changes are saved in Cache and/or written back to Backing Store (Database).
      4. Events are sent to respective destination(s).
Leave the comments below if it helps or if there is any question. I would be happy to help you all.
Thank You Guys, See you later. Till then, Good Luck. and Have a great CEP Exploration.

Please do like, share and subscribe. This would help me grow my blog.

- Vijay Prakash Tiwari

Comments

  1. This blog is of great help in understanding the RTC in detail. Thanks for sharing your knowledge Vijay!

    ReplyDelete

Post a Comment

Popular posts from this blog

Art of Observation: Introduction

Since Ancient times, Observation has been a fundamental behavior that is being practiced by most of the living creatures. It has also been one of the secret ingredients in evolution for many Species. Due to Humans' strong observatory skills, we find ourselves on the peak of the ladder of evolution. Therefore, the majority of the time, we observe things around unconsciously as just another natural behavior. Power of Observation is so vague and wide that if one can understand it, learn it, control it, and practice it, then for that individual, winning the battle for success is certain. Observation has been the primary source of success for every example we see around. For Example, all innovations and discoveries in science and technology and cultural practices are resultant of observation. It has been a central key activity in Historical, Economical, and Political belief system. If we say, necessity is the mother of all discoveries, then we should also understand that observati

TIBCO BusinessEvents 5.x : Understanding CEP and Getting Started

Complex Event Processing (CEP) is a set of technologies that allows  events  to be processed on a continuous basis. TIBCO offers a complete platform to enable CEP that is,  TIBCO BusinessEvents. It is a Rule Engine where Event-Based Programming Paradigm is followed that has Java at its core. CEP is unlike conventional event processing technologies, however, in that it treats all events as potentially significant and records them asynchronously. CEP Applications are event-driven in nature, therefore some of its aspect has real-time behavior. For example, “Situation Awareness,” “Sense and Respond,” or “Track and Trace” are some of the aspects that CEP application can have that overlap in actual business situations. Learning TIBCO BusinessEvents (BE) for developing such CEP Solution can open up the world of Even Processing for developers. TIBCO BusinessEvents Rule Engine's working can't be understand without understanding what "Run to Completion" Cycle is