Products | Versions |
---|---|
TIBCO BusinessEvents Enterprise Edition | - |
Not Applicable | - |
Resolution:
Description:
============
Aborting RTC() on exception in the TIBCO BusinessEvents preprocessor .
Environment:
============
TIBCO BusinessEvents 5.1.x
Operating System(s): All
Resolution:
============
Suppose the design specifications of an application demands that on execution of an if else block in the pre-processor as shown below, the RTC needs to be halted.
In this scenario the RTC() can be halted by calling the method abortRTC() inside a rule which in turn has to be invoked by creating an Exception ontology object .
System.debugOut("In Exception Rule before Calling abort RTC");
Engine.Rtc.abortRTC();
System.debugOut("In Exception Rule after Calling abort RTC");
Steps :
1).Create JMS event with payload A . Please note that the ttl for the event is 0 .
2). Start the default processing unit of the JMS channel project .
3). In the sample from the preprocessor an exception is thrown and a subsequent exception rule is fired which calls abort RTC().
4).The message is also persisted in the EMS queue but note that this message would not be available to other business events engines unless the current engine is restarted.
// Pre Processor body pseudo code .
Concepts.BookDataConcept bookConcept ;
Concepts.ExceptionConcept exceptionConcept ;
if(bookdataevent@payload == "A")
{
System.debugOut("Before New Exception Event Created");
exceptionConcept = Create the exception concept here
System.debugOut("New Exception Event Created");
} else {
bookConcept = Create the proper concept here
System.debugOut("No Exception Thrown");
}
// Invoking abortRTC() in rule body
System.debugOut("In Exception Rule before Calling abort RTC");
Engine.Rtc.abortRTC();
System.debugOut("In Exception Rule after Calling abort RTC");
Attachments:
============
JMSChannel.7z