Thursday, March 20, 2014

IBM Business Process Manager Integrations: Designing SCA Based MQ Integration for BPM

Problem Statement:
For integrating IBM WebSphere MQ with IBM Business Process Manager (BPM) applications, solutions can be built using SCA components bundled into main business process applications to consume messages from external messaging systems when BPM Advanced edition is used. If the business requirement is to have multiple active snapshots then IBM BPM deploys separate SCA Modules for each snapshot. Though the solution works, it is not an elegant solution because as the number of snapshots increases, the number of listeners (SCA Modules) on MQ will continue to increase.

The solution is to separate SCA modules from main business process application by creating a lightweight standalone process application with SCA components which in turn routes the incoming message to the main business process which is expecting the message from the external system. Use the MQ export component to listen on MQ and trigger short process using one-way interface, the short process will have all system activities to digest incoming message and route it to appropriate messaging event (ME) of main business process using UCA components.

To explain the design, assuming the following:
  • Input messages are XML messages over MQ and IBM BPM Advanced 8.0 environment. 
  • External Message is expected after business process has been started, i.e. external message event is not used to trigger the business process instead used within the process.

Process Designer Components
  • Create Process App “MQ Integration” with BPD called “Process MQ Message” which needs to be triggered when the MQ message arrived in queue using SCA component in IID. This process should have all required logic to send the message to appropriate main process with correlation information.

  • The BPD should have appropriate input variables based on payload.
  • The BPD should also have service to send the message (payload) to main process using UCA. Use correlation id such as Instance Id to send the payload to correct process which is expecting the payload.
  • Create a toolkit for UCA to send the message from “Process MQ Message” to actual (main) BPD and include this UCA tool kit in both main process app and Integration process app.
  • Another option is to drop the message with UCA format into SIB (event queue) which would automatically triggers waiting IME based on correction id. In both approaches, payload should have correlation id or any other data which can be used to derive actual correlation information.
Integration Designer Components
  • Create MQ Export one-way invocation style to start BPD “Process MQ Message”.
  • Configure MQ Export to listen on MQ queue using appropriate connection details.
  • Configure data handler based on payload, OOB data handler UTF8XMLDataHandler is used in this case as payload is XML.
When the message arrives in the MQ queue, SCA component will trigger BPD “Process MQ Message” in “MQ Integration” application with payload as input. The BPD in turn sends the message to actual process using UCA with correlation information available in payload.

When multiple main process snapshots are active on process server, there will be only one SCA module from Integration application “MQ Integration” listening on MQ Queue and routing the messages to all active snapshots of main process.

  • As the SCA components are not bundled with main business process app, only one instance of SCA component (one listener) will be deployed on process server
  • Easy to maintain as it is not tightly coupled with main business process application.
  • It needs to be deployed separately.
Decoupling SCA Modules from business process application will allow changes to integration logic and routes the messages to appropriate process without impacting main business process application much when production environment expect to have multiple active snapshots.

Shanmugam Golla is Solution Architect proficient in developing web-based enterprise applications using JEE, BPM, and SOA technologies. Possesses over 11 years of experience in all phases of software development, with exposure to all aspects of project life cycles, from inception to production support. Shanmugam has lead teams for top-tier consulting firms providing multifarious and complex IT business solutions to prestigious firms in banking, finance, securities, and insurance brokerage.