Following is the general steps for the server collector:
<kColl id="html"> <field id="SmartCollectorHandler" value="com.ibm.btt.poc.util.SmartChannelDataCollectorPoC"/> <field id="smartCollectorConfigFile" value="jar:///bcConfig/SmartCollect.xml"/> </kColl>The SmartCollectorHandlerfield is the class of the smart collector handler. It should extend class com.ibm.btt.channel.AbstractSmartCollector and implement the processResult (Map<String> result) method. This method process the parameter result, and then return the Boolean value according to user-defined logic. If the method return true, it performs the smart collecting; else if it return false, it will not collect the data. The smartCollectorConfigFilefield is the smart collector configuration file path.
<SmartChannelDataCollect.xml> <props id="classTable"> <entry key="SmartCollectorConfig4Transaction" value="com.ibm.btt.channel.SmartCollectorConfig4Transaction"></entry> <entry key="SmartCollectorConfig" value="com.ibm.btt.channel.SmartCollectorConfig"></entry> <entry key="SmartDataCollectJMSImpl" value="com.ibm.btt.channel.smart.dao.jms.SmartDataCollectJMSImpl"></entry> <entry key="SmartDataCollectDefaultImpl" value="com.ibm.btt.channel.smart.dao.jpa.SmartDataCollectDAOImpl"></entry> </props> <SmartDataCollectJMSImpl id="jmsDAOImpl" jmsConnectionFactory="jms/SmartChannelCF" jmsSendQueue="jms/SmartQueue"> </SmartDataCollectJMSImpl> <SmartDataCollectDefaultImpl id="smartDAOImpl"> </SmartDataCollectDefaultImpl> <SmartCollectorConfig id="smartCollectorConfig" sampleRateRuleServiceName="globalDataCollectorRuleService" smartDAO="smartDAOImpl"> <ref Injection="transactionCollectorConfig" refId="TransactionDataCollectorConfig"/> </SmartCollectorConfig> <java.util.ArrayList id="TransactionDataCollectorConfig"> <SmartCollectorConfig4Transaction transactionID="accountTransferOp" sampleRateRuleServiceName="transferDataCollectorRuleService" extendBean="com.ibm.btt.poc.transfer.AccountTransferBehavior" actionType="behavior"> <map Injection="dataMap"> <entry key="acctFrom" value="accountNumber"></entry> <entry key="amount" value="amount"></entry> </map> </SmartCollectorConfig4Transaction> </java.util.ArrayList> </SmartChannelDataCollect.xml>The service class should extend the class com.ibm.btt.channel.ruleprovider.java.JavaCodeRuleProviderService, which is included in the bttruleprovider.jar. The actionType should be behavioror visit. Other value is not accepted. The extendBeanshould be predefined. If the actionType is behavior, the class should extend the class com.ibm.btt.channel.smart.data.BehaviorLog. If the actionType is visit, the class should extend the class com.ibm.btt.channel.smart.data.VisitLog.