Defining the rule provider service

The rule provider is implemented as an IBM® WebSphere® Multichannel Bank Transformation Toolkit service. As with other WebSphere Multichannel Bank Transformation Toolkit services, the rule provider must be defined in the service.xml file.

WebSphere Multichannel Bank Transformation Toolkit provides two pre-built rule provider services:

ILOG connector service

IBM ILOG® can be used as the rule engine to store channel management policy. The service is used to connect ILOG to access the channel policy defined in it. WebSphere Multichannel Bank Transformation Toolkit ILOG connector service supports the following attributes described in Table 1.
Table 1. Attributes supported by the ILOG connector service.
Name Description
id The unique identifier of this service
ruleID The rule ID defined in ILOG accessed by service
mode The mode of accessing ILOG. There are two possible values: J2EE, J2SE and WebService. The default value is J2EE
WSClientBeanName . The name of class to access ILOG when the mode is WebService. The class is generated by WSClientBeanName
A sample service definition in the service.xml file is provided her:
<com.ibm.btt.channel.ruleprovider.ilog.ILogRuleProviderService
		id="checkTransferAmountILogRule" ruleID="/checkChannelRuleApp/BTTChannelRules" />

Java Code Rule Provider Service

WebSphere Multichannel Bank Transformation Toolkit provides com.ibm.btt.channel.ruleprovider.java.JavaCodeRuleProviderService as the base class for technical developers to implement the rule provider service in Java Code. Technical developers must extend the JavaCodeRuleProviderService base class and override the checkRule method.

public Map<String, Object>  checkRule(Map<String, Object>  params)
The method is used for checking business policy rules and decides whether the request can be accepted.
Figure 1 is a sample implementation of the JavaCodeRuleProviderService base class, in which any transfer amount that is more than 10000 will be rejected.
Figure 1. Sample implementation of the JavaCodeRuleProviderService base class

Furthermore, technical developers can implement their owner policy provider service such as supporting other third part rule engines. To implement policy provider service, technical developers need to extend the com.ibm.btt.base.Service abstract class and implement the com.ibm.btt.channel.ruleprovider.IBTTRuleProvider interface.