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:
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.
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.
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.
TIBCO Object Service Broker Programming in Rules about TIBCO Object Service Broker transaction processing.