![]() |
Copyright © TIBCO Software Inc. All Rights Reserved |
From TIBCO Object Service Broker you can pass control to and receive control back from a routine outside TIBCO Object Service Broker operating boundaries. When an external routine is called, the following takes place:
• The routine must be written in a language whose implementation is compatible with the required C prototype.Even though TIBCO Object Service Broker allows only static methods as external routines, non-static methods of a particular target class can be invoked indirectly, as shown here:
1. Define a (mapping) class that manages a mapping of handles (for example, integer values) to instances of a target class.
2. Have the mapping class implement a static method (a class factory) that creates instances of the target class and returns a handle to the instance while adding, to the internal data structure, the mapping from the handle to the instance.This class factory method can be called by a TIBCO Object Service Broker application to create instances of the target class.
3. For each instance method of the target class that you want to invoke from the TIBCO Object Service Broker application, have the mapping class implement an intermediate static method. This method takes a target class instance handle and arguments corresponding to the arguments of the instance method to be invoked.The intermediate method should resolve the handle into a class instance reference and call the instance method, passing the required arguments to it.The mapping class methods should also check handles for validity and possibly implement further (static) methods. These methods are then available for a TIBCO Object Service Broker application to manage the life cycle of the target class instances.The external routine can be invoked from within a rule either as a function or explicitly with the CALL statement as in the following examples:
The following shows the process flow between TIBCO Object Service Broker and an external routine.TIBCO Object Service Broker Programming in Rules for information about coding rules and the rules language
![]() |
Copyright © TIBCO Software Inc. All Rights Reserved |