Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 10 Accessing External Routines : Functional Overview

Functional Overview
How Does TIBCO Object Service Broker Process an External Routine?
You can pass and receive control back from a routine outside TIBCO Object Service Broker operating boundaries. When an external routine is called, the following takes place:
1.
2.
TIBCO Object Service Broker calls the routine and waits for control to be passed back to it when the external routine is finished.
3.
Process Flow
This illustration shows the process flow between TIBCO Object Service Broker and an external routine.
Steps Required to Use an External Routine
The major steps in preparing and executing an external routine are:
1.
Routines should be re-entrant where possible. This is not a requirement but it saves storage in a multiple-session system. Also, these routines should use standard assembler linkage conventions.
2.
3.
When these steps are completed, a TIBCO Object Service Broker rule can invoke the external routine.
Transaction Level of the Routine
TIBCO Object Service Broker treats all external routines in the following way: during a transaction, the routine is loaded once per transaction level, TIBCO Object Service Broker branches and links to the routine whenever it is called, and deletes it when the transaction ends.
For example, if you execute the ABC rule from the workbench, and this rule calls an external routine, the external routine is loaded for transaction level 0. The same rule can access table XYZ, invoking a trigger rule in the process. If the trigger rule calls an external routine, the routine is loaded for transaction level 1. This all takes place in the same transaction but at different levels.
Cleanup of System Service Requests
If an external routine requests system services, it should perform any necessary cleanup (for example, issuing FREEMAIN macros to release storage obtained by the GETMAIN macros). Code these requests so that they operate independently of the environment (TSO, CICS, IMS, and so on) where they execute.
Error Handling
An external routine can override TIBCO Object Service Broker error-handling. It can have its own STAE/ESTAE macro to handle abnormal terminations and SPIE/ESPIE to handle program interrupts. If it does, it must restore TIBCO Object Service Broker error-handling, including the program mask, before returning. Failure to do so causes unpredictable results.
See Also
TIBCO Object Service Broker Programming in Rules about TIBCO Object Service Broker transaction processing.

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved