Integration between BusinessEvents and ActiveMatrix BusinessWorks enables each product to take advantage of the strengths of the other product. ActiveMatrix BusinessWorks can use BusinessEvents as a light-weight rules engine, for example, and BusinessEvents can use transports available in ActiveMatrix BusinessWorks.
To see integration features in an example project, open the project in this directory: BE_HOME/examples/FraudDetectionBEBW/.With the in-process method of integration, the integrated project runs in a single container, that is, a single JVM. The JVM can run as a BusinessEvents engine, or as an ActiveMatrix BusinessWorks engine.When BusinessEvents is the container, the ActiveMatrix BusinessWorks engine can communicate with resources outside of the BusinessEvents container. However, when ActiveMatrix BusinessWorks is the container, the BusinessEvents engine cannot communicate with resources outside of the ActiveMatrix BusinessWorks container.Which engine you run as the container depends on what you want to achieve. Choice of container affects project design and runtime behavior, as explained in Design Considerations.Out-of-process modelYou can also use the out-of-process integration model. It enables ActiveMatrix BusinessWorks to interact with BusinessEvents using Send Event and Receive Event activities, as explained in Chapter 11, Out-of-Process ActiveMatrix BusinessWorks Integration.Managing a single container, however, simplifies maintenance and enables horizontal scaling. It involves less management overhead than that required by the out-of-process model of integration.To enable an ActiveMatrix BusinessWorks process to call a BusinessEvents rule function, you configure the following resources:Invoke RuleFunction Activity Provided in the BusinessEvents Activities palette, an Invoke RuleFunction activity invokes a BusinessEvents rule function in a specified agent instance (rule session) and passes a concept or event or BusinessEvents primitive (except Object) to it. The Invoke RuleFunction activity can be combined with any process starter. Execution is synchronous. For ActiveMatrix BusinessWorks containers only, you also specify a RuleServiceProvider Configuration.Note that BusinessEvents generates its own threads to execute the rule function that the ActiveMatrix BusinessWorks process calls through the Invoke RuleFunction activity. Then the ActiveMatrix BusinessWorks thread is released and the process is set to a pending state. When the rule function returns, the ActiveMatrix BusinessWorks process resumes its Ready state.RuleServiceProvider Configuration Required for ActiveMatrix BusinessWorks containers only. Provided in the BusinessEvents Activities palette, a RuleServiceProvider Configuration resource is used to identify the location of the BusinessEvents application at runtime.The integration model provides a BusinessWorks category of functions. the functions are as follows:
● BusinessWorks.invokeProcess(): Invokes an ActiveMatrix BusinessWorks process in synchronous mode and waits for completion of the process before returning to the rule or rule function. Starts the process engine if it is not already started. Returns an event, or null. Generates an advisory event if it times out.
● BusinessWorks.startProcess(): Invokes an ActiveMatrix BusinessWorks process in asynchronous mode and returns the process ID (job ID). Upon completion, the ActiveMatrix BusinessWorks process passes an event to the rule function specified in an argument of startProcess(). Starts the process engine if it is not already started.
● BusinessWorks.cancelProcess(): Cancels the specified ActiveMatrix BusinessWorks process. Useful for canceling a long running job. (Cancellation is not guaranteed because the process may complete before receiving the cancellation command.)
● BusinessWorks.init(): For use with BusinessEvents containers only (but harmless if present and not needed). Initializes the ActiveMatrix BusinessWorks engine. Optional.
● BusinessWorks.shutdown(): Shuts down the ActiveMatrix BusinessWorks process engine. Optional. You can use this function to shut down the ActiveMatrix BusinessWorks engine when it is no longer needed.
Copyright © TIBCO Software Inc. All Rights Reserved.