Open topic with navigation

TIBCO BusinessEvents® Enterprise Edition 6.3.1

# Success and Failure Listeners (Callback Functions)

For each instantiated and deployed pattern instance, you configure two callback rule functions. One acts as a success listener and the other as a failure listener.

Note: Do not perform time-consuming operations in a listener. A listener should return control quickly to ensure efficient functioning of the pattern service.

The listeners execute every time a pattern succeeds or fails.

On successful completion of a pattern the service invokes the success listener. If the pattern fails because of a timeout or elements of the pattern arriving out of order, then it invokes the failure listener.

Success and failure listeners have the same arguments. Advanced listeners have an additional argument.

## Functions that Cannot be Used in Listeners

Functions that read, modify, or delete concepts and events, such as `Instance.deleteInstance()`, cannot be used in the callback functions that you use as listeners. These functions must execute in the context of a run to completion cycle (RTC). They cannot be used in success or failure listeners, which run in a different thread. (See the functions documentation for details on thread pool management functions such as the `Pattern.Manager.Advanced.setPoolSize()` function.)

In order to use functions that execute in the context of an RTC, create a rule that executes the functions, and create an event with all the necessary information. Send the event using `Pattern.IO.toDestination()`, preferably on a local channel. The event is asserted in an RTC and triggers the rule, which executes the desired functions.

Tip: TIBCO BusinessEventsFunctions that are valid in the query engine are also valid in the pattern engine.
Subtopics

Did you find this helpful?

YesNo
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO BusinessEvents® Enterprise Edition

Copyright © 2004-2024. Cloud Software Group, Inc. All Rights Reserved.