Saturday, June 1, 2019

TIBCO BW 5.x Best Practices - Part 4 - Global Variables and Transactions

This is Part 4 of the series on Best practices for TIBCO BusinessWorks (BW) 5.x platform. You can check out previous parts at Part 1Part 2 and Part 3. For evaluating against these and more best practices, do a code review of your BW 5.x projects or EAR files, use our free online version at BW5 Code Scanner

This post covers the best practices about Global variables and Transactions

Global Variables

Global variables are available in memory as a local copy. They are internally represented as XML structure in the form of $_globalVariables. One of the best practices to follow is to review each project before deployment and to remove unused global variables.

Unused global variables often increase latency, especially iteration groups where XPATH formula evaluates Global Variables instead of constants. The Global variable XML tree must be walked by the engine to find the correct element. Since it takes longer to access the last element than the first element, unused elements in the middle increase latency. After removing unused Global variables, rearrange Global Variables from most frequently used to least frequently used variables. When using a global variable multiple times, especially, in repeated elements mappings, assign the Global variable value to a local variable and use it in iterations or repeating element mappings


A transaction is a logical unit of work that allows grouping multiple activities into an atomic execution unit. BW supports the following types of transactions: JDBC, Java Transaction API (JTA) UserTransaction, XA Transaction.

The following guidelines are recommended for using transactions in BW
  • The resources must always be available or else the transaction will fail and must be rerun. 
  • A process that failed in the middle of a transaction should never be resumed in TIBCO Administrator since transactional context and transaction manager are no longer available.
  • A transaction group should be accompanied by an error transition to handle the rollback case. In the absence of error transition, the process instance will throw an exception and may end prematurely
  • Do not have external invocation activities like HTTP Send Request etc. in a transaction group as they cannot be rolled back

In Summary
Remove unused Global Variables and rearrange them from most frequently used to least frequently used. Always create an error transition out of a transaction group and handle appropriately

No comments:

Post a Comment