Chapter 12 In-Process ActiveMatrix BusinessWorks Integration : Design Considerations

Design Considerations
This section presents some considerations to keep in mind when you are designing your integration project.
Integration Scope
You can only use BusinessEvents rule sessions and rule functions and ActiveMatrix BusinessWorks processes that are configured in the TIBCO Designer integration project, and they must also be included in the relevant EAR files deployed for the integration project.
You can use all the integration features regardless of which product’s engine is used as the container, ActiveMatrix BusinessWorks or BusinessEvents, within the guidelines presented in this chapter.
Avoiding Threading Issues
It is possible to configure a complex execution path in your project, for example, one in which BusinessEvents invokes an ActiveMatrix BusinessWorks process, which in turn invokes a BusinessEvents rule function, and so on.
The BusinessWorks.InvokeProcess() rule function and the Invoke RuleFunction activity both operate synchronously. Both attempt to acquire a lock on BusinessEvents working memory.
Take care to avoid threading issues. Check your execution path carefully to ensure that there are no threading issues leading to deadlock. In general, make sure that no action in the entire execution path attempts to use the same working memory that is already locked.
For example, if you execute BusinessWorks.InvokeProcess() function in BusinessEvents, then in the ActiveMatrix BusinessWorks process it calls, you cannot use an Invoke RuleFunction activity to invoke a rule function in the same rule session. You could invoke a rule function running in a different rule session, however.
Use of Global Variables and Environment Variables
All of the variables and properties set in TIBCO Designer and TIBCO Administrator and in the container’s TRA file are available to the contained engine at runtime.
Design Considerations Related to Container
The engine used as the container is responsible for state and object management, fault tolerance, and logging. The contained engine delegates management of these features to the container. The main points to keep in mind are listed below.
Use In Memory object management in BusinessEvents. Other OM methods are not supported.
The ActiveMatrix BusinessWorks engine TRA file is not used. Provide any properties needed, such as classpath and palette path, in the BusinessEvents engine TRA file or in a property file, using the -p option. (See Configuring the Environment for BusinessEvents Containers).
The BusinessEvents engine TRA file is not used. Provide any properties needed for BusinessEvents in the ActiveMatrix BusinessWorks property file.
TIBCO Hawk microagent
With configuration of one extra property in the BusinessEvents TRA file, you can use TIBCO Hawk methods for BusinessEvents and ActiveMatrix BusinessWorks. See the procedure in the section Configuring the Environment for BusinessEvents Containers for details.
Only the TIBCO Hawk methods for ActiveMatrix BusinessWorks are used.
Fault Tolerance
ActiveMatrix BusinessWorks fault tolerance is used. Do not configure BusinessEvents in fault tolerant mode.
Fault Tolerance With a BusinessEvents Container
When BusinessEvents is the container, ActiveMatrix BusinessWorks checkpointing can be used in a limited way. Do not use ActiveMatrix BusinessWorks checkpointing in any process that is called by startProcess() or invokeProcess(), or in any process called by such processes.
When a secondary BusinessEvents engine takes over as primary, it starts the ActiveMatrix BusinessWorks engine (if it was running in the primary at time of failure). On failback to the primary engine, the secondary then stops the ActiveMatrix BusinessWorks engine (and therefore any ActiveMatrix BusinessWorks channels also).
Tips for Working With ActiveMatrix BusinessWorks Containers
Keep the following points in mind when designing your project.
BusinessEvents communicates only with the ActiveMatrix BusinessWorks process that invokes it. BusinessEvents channels are not available.
Do not execute any action in a BusinessEvents startup rule function that results in use of BusinessWorks.invokeProcess() or BusinessWorks.startProcess() functions. The ActiveMatrix BusinessWorks engine may not be fully initialized when these functions are executed in a startup rule function (or in any rule in the RTC cycle of a startup rule function).
Before deploying the ActiveMatrix BusinessWorks instance using TIBCO Administrator, first disable the BAR (BusinessEvents Archive).
Tips for Working With BusinessEvents Containers
Add both the PAR and BAR or BARs to the same EAR. This avoids the necessity of identifying the ActiveMatrix BusinessWorks processes to the BusinessEvents engine at runtime.
Before deploying the ActiveMatrix BusinessWorks instance using TIBCO Administrator, first disable the PAR (BusinessEvents Archive).