You can use channel management framework to rapidly develop multi-channel business integration solution, and rapidly change/deploy business rules in your production. Channel management provide bank customers with unified business data integration across different channel, along with a unified user experience cross channel.
Channel management includes the following components: policy management, channel data model, and rule provider. Following picture is the architecture figure: Policy management gets the rule parameters from channel data model and user's request, and then passes these parameters to rule engine by rule provider to do rule checking. Policy management includes channel policy management and transaction policy management.
Channel policy management controls the policy in the channel scope, and transaction policy management controls the policy in the transaction scope. Channel data model provides the DAO interfaces to access persistent channel data, for example, policy base data, channel runtime data, and so on.
Rule provider provides a common interface to visit rule engine. There are pre-build rule providers are implemented as UDTT services: ILog Connector Service and Java Code Rule Provider Service.
UNICOM® Digital Transformation Toolkit (UDTT™) policy management includes channel policy management and transaction policy management. Channel policy management controls the policy in the channel scope.
Policy Management provides channel policy handler to handle channel scope policy. And channel policy handler is invoked when any requests enter UDTT servers. To use the channel scope policy, you need:
1 Implement the AbstractChannelPolicy class. UDTT provides an abstract channel policy handler--- AbstractChannelPolicy, to handle the policy in the channel level. The docheck method in AbstractChannelPolicy provides a default implementation to use rule service to connect to the rule engine, and you can extend it according to your needs. Then implement the following two abstract methods:
▪ getInputParameter, to construct the input parameters for docheck method using the data from the channel context or getting from data store;
▪ processResult, to parse the result returned from rule engine;
The PolicyResult is the outcome of processResult method, which includes the execution result of policy check. If check pass, then continue the request processing, otherwise throwing exception. The messages in PolicyResult are used to keep the messages generated during rule check.
2 Configure the channel policy handler after you implement the AbstractChannelPolicy. Then configure the related channel in file btt.xml to use it. The format of configuration is as following:
▪ The channelPolicyHandler field is the implementation of the abstract channel policy handler.
▪ The ruleService value is the id of rule service.
Note If you configure the channel policy handler in HTML and Java Channel, it works for all requests; but for XML channel, you need to create session in a servlet (For example, the com.ibm.btt.xml.servlet.CreateSession servlet in BTTMultiChannelSample), and channel policy handler does not work on the servlet.
Channel data model provides the pre-build extensible interfaces, and uses the JPA technique to access persistent channel data. Channel data model includes Database table, Java data bean, and DAO API.
An instance of Register Account table (or Channel Runtime table) must depend on an instance in Channel Policy Base table. When an instance in Channel Policy Base table is removed, the corresponding instances in Register Account table (or Channel Runtime table) is removed automatically.
Java data bean is Java abstract for the data in data table. Every data bean is responding to a database table which contains channel data. For example, ChannelPolicyBase is responding to Channel Policy Base table.
The following table shows the details about the data beans.
JavaBean Name
Database Table
Content
User case
Data originator
com.ibm.btt.channel.data.ChannelPolicyBase
Channel Policy Base
Channel policy base data
Read often, update/delete rarely, (read when user login
When User sign channel
com.ibm.btt.channel.data.ChannelRuntime
Channel Runtime
User runtime behavior on channel
Read/update often, delete rarely, (read/update when user login/ transfer)
When User sign channel
com.ibm.btt.channel.data.RegisteredAccounts
Registered Accounts
Registered Account for each channel signed(part of channel base data)
Read often, update/delete rarely, (read when user login)
When User sign channel
com.ibm.btt.channel.data.FeePolicyBase
Fee Base
Fee related
Read often, update rarely, no delete (read when application start )
Channel data model provides a series of DAO API, and you can use them to operate the channel data.
The following figures are DAO APIs:
public interface ChannelPolicyBaseDAO { public ChannelPolicyBase getChannelPolicyBase(ChannelPolicyBasePK id) ; public void addChannelPolicyBase(ChannelPolicyBase channelPolicyBase) ; public void deleteChannelPolicyBase(ChannelPolicyBasePK id) ; public void updateChannelPolicyBase(ChannelPolicyBase channelPolicyBase) ; public List<RegisteredAccounts> getRegisteredAccountsNumber(ChannelPolicyBasePK id) ; public void addRegisteredAccountsNumber(ChannelPolicyBasePK id, String[] accountNumbers) ; public void setAccountNumberAlias(ChannelPolicyBasePK id, String accountNumber, String accountAlias) ; public void removeRegisteredAccountNumber(ChannelPolicyBasePK id, String[] accountNumbers) ; }
An instance of ChannelPolicyBase is responding to a line in Channel Policy Base table. And ChannelPolicyBasePK is the key of ChannelPolicyBase, which including the fields:
▪ custId
▪ channelId
The interface to operation on ChannelRuntime entity:
public interface ChannelRuntimeDAO { public ChannelRuntime getChannelRuntime(ChannelRuntimePK id) ; public void addChannelRuntime(ChannelRuntime channelRuntime) ; public void deleteChannelRuntime(ChannelRuntimePK id) ; public void updateChannelRuntime(ChannelRuntime channelRuntime) ; public void increaseTransferedAmount(ChannelRuntimePK id, Double amount) ; public void increaseTransferedCount(ChannelRuntimePK id) ; public void increasePasswordErrorCount(ChannelRuntimePK id ) ; public void resetChannelRuntime(ChannelRuntimePK id ) ; public void resetChannelRuntimeAll() ; }
An instance of ChannelRuntime is responding to a line in Channel Runtime table. And ChannelRuntimePK is the key of ChannelRuntime, which including the fields:
▪ custId
▪ channelId
The following codes give an example to use these interfaces:
In the example, a new ChannelPolicyBase instance is created in the DB. The class ChannelPolicyBaseDAOImpl is the implementation class of ChannelPolicyBaseDAO; the class ChannelRuntimeDAOImpl is the implementation class of ChannelRuntimeDAO.
The UNICOM® Digital Transformation Toolkit (UDTT™) Channel Data Model follows the JPA standards to persist channel data. Before deploying, you should follow the JPA standards to configure the JDBC Connections. The following steps introduce how to configure:
1 Specify the file bttchanneldata.jar in your class path. This JAR file is located at ${btt_root}/lib/bttchanneldata.jar.
2 Specify the file com.ibm.ws.jpa.thinclient.0.jar standalone Java archive (JAR) in your class path. This standalone JAR file is available from the client and server installation images. The location of this file on the client install image is ${app_client_root}/runtimes/com.ibm.ws.jpa.thinclient.0.jar. The location of this file on the server install image is ${app_server_root}/runtimes/com.ibm.ws.jpa.thinclient.0.jar.
3 Specify the database connection driver jar in your class path. For DB2 v9 or v9.5 or v9.7, the driver JAR files are db2jcc.jar and db2jcc_license_cisuz.jar; For Oracle 11, the driver JAR file is ojdbc14.jar; For SQL Server 2005, the driver JAR file is sqljdbc.jar.
4 Create database, and then run the DDL files accordingly to the database type to generate or update the tables. The DDL files are available from the file bttchanneldata.jar. For DB2, the DDL file is channelManagement.DDL; For Oracle, the DDL file is channelManagement_oracle.DDL; For SQL Server, the DDL file is channelManagement_sqlserver.DDL.
5 In the persistence.xml, specify your database configuration options.
▪ If you want to connect to DB in URL mode, specify as following: