Quotes

Tuesday, November 1, 2016

Integrate IBM Integration Bus with IBM Operational Decision Management using Decision Service Node


Introduction

This article describes the use of decision service node in IBM Integration Bus V9.0 and how to use this node to integrate an external ODM with IBM Integration Bus.
The external ODM referring here is IBM Operational Decision Management V 8.5 or above.
IBM Integration bus provides enhanced integration support with BPM and IBM ODM (WODM previously). The built in node, Decision Service node, provides an inbuilt capability in IIB to author, integrate, deploy and run simple schema based rules. It also provides the capability to call external ODM repository to get the full decision service capabilities.
Using an external ODM gives the benefits of segregating and maintaining the business rules separately from the integration layer or the application layer. Hence it provides the visibility of business rules to business users outside an Integration layer. It gives the organization the flexibility of implementing the changes in business rules without affecting the application or integration module. The Decision Center of ODM provides web console interface to the business team to change and deploy the rules on the fly without depending much on IT team.
Business decisions in an ODM can provide:
  • Business level data Validation
  • Message Routing
  • Message Enrichment/Augmentation
There are some limitations for using the built in node to call external ODM exists such as:
  • Only rules having schema based XOM can be imported and deployed in IIB
  • The rule parameter must be a Schema type.
To demonstrate this integration, I am using a simple rule project derived from dynamic XOM to get the routing details. This rule project uses a decision table to find the routing endpoints. This project is been maintained in decision center for the convenience of business users to modify and deploy whenever required from the business console.
In order to use the routing business rules in our message flow, we have few options of integrating the rule engine (Rule Execution Server-RES) in message flows such as
  • Integrating by using Web services (REST or SOAP).
  • Use JMS nodes to interact asynchronously with Rule execution server (Using RES MDB)
  • Use JAVA EE or JAVA SE rule sessions
  • Use the built in node, decision service node, to call the ODM Rule execution server.
The decision service node gives the advantage among other options such as real time, in-process performance and caching of rule set in execution group.
Note:  The support pack IAM9 can be used in previous version of IIB (WMB  V8 and V7) to invoke rules from an external ODM (WODM V 8.0 or 7.5 or 7.1).
In order to integrate ODM using decision service nodes, we need to setup a configurable service to connect to ODM repository. And this configurable service needs a JDBC service to connect to ODM repository database.
So we need to create a JDBC Configurable service pointing to ODM repository first. Sample commands as below for a reference:
1
mqsicreateconfigurableservice WBIBROKER9 -c JDBCProviders -o ODMDB -n connectionUrlFormat,connectionUrlFormatAttr1,connectionUrlFormatAttr2,connectionUrlFormatAttr3,connectionUrlFormatAttr4,connectionUrlFormatAttr5,databaseName,databaseType,databaseVersion,description,environmentParms,jarsURL,jdbcProviderXASupport,maxConnectionPoolSize,portNumber,securityIdentity,serverName,type4DatasourceClassName,type4DriverClassName -v "jdbc:db2://[serverName]:[portNumber]/[databaseName]:user=[user];password=[password];","","","","","","default_Database_Name","DB2 Universal Database","9.1","default_Description","default_none","C:\Program Files\IBM\SQLLIB\java","true","0","50000","DB2SecurityIdentity","localhost","com.ibm.db2.jcc.DB2XADataSource","com.ibm.db2.jcc.DB2Driver
The above command will create a configurable service named ODMDB which will connect to a DB2 database using JDBC provider. This database is the one which is used by Rule execution server and Rule team server.
Note: the ‘DB2SecurityIdentity’ is already been created with DB2 username and password.
Next update the configurable service as follows:
1
mqsichangeproperties WBIBROKER9 -c DecisionServiceRepository -o Default -n JDBCProviderName,resManagementHost,resManagementPort,resManagementProfiling  -v "ODMDB","localhost","9083","false"
Note: You must use the default configurable service named ‘Default’You cannot create a new decision service configurable service. You must update the ‘Default’ decision service repository configurable service.
Next, update your broker to enable decision service mode:
1
mqsimode -x DecisionServices
Follow the steps mentioned here to import the rule app into integration toolkit. Import the routing rule app in to IIB toolkit. It will create a decision service (.rules) which can be used in any message flow application.
Now create a message flow and use the rule that we imported into the flow (drag and drop in to the rule flow editor).
Messageflow_DecisionEmbedded
Decision service node properties are configured as below:
NodeProperties
Create a BAR file and deploy the flow. Attach the debug session to see the rules invoking.
Put break points and put a sample message. You can see the message tree before and after the Decision service node. If Rules invoked successfully, it will propagate through the out terminal.
Before calling rule service:
beforeNode
After calling rule service:
AfterNode
The next route node will just check the Xpath for the correct message tree. Finally the message will propagate to multiple endpoints which are retrieved from ODM rule engine.
Now login to Rule Team server to edit the rule table and deploy dynamically.
Edit the decision table in rule team server console:
EditTable
Save the changes. Now deploy the rule app from decision console to get the new changes:
deployruleapp
Now put input message again and see the rule retrieved from the debug perspective.
You can see the modified rules reflected immediately here:
AfterRuleUpdated
Note: By default, the hot deployment from business console will not reflect immediately to the execution group. You need to configure the Rule execution server for TCP/IP monitoring. You can find the steps for this from here.
If you have not configured this, the rules will not reflect immediately. You need to restart the execution group to get the latest rules.
Conclusion
IBM Integration Bus + IBM Operational Decision management will give the benefit of segregating the business rules out of the ESB layer and will accelerate the enterprise with frequently changing business rules.  It will also enable business and IT department to collaborate more efficiently to achieve the business changes and deployments.
References

No comments:

Post a Comment