In BTT definition files, you can use an <import> tag to reuse the elements defined in reusable BTT definition files.
<data-import.xml> <bColl id="customerBean" bean="com.ibm.btt.bean.test.Customer"></bColl> <kColl id="account"> <field id="loan" value=""></field> <field id="money" value=""></field> </kColl> </data-import.xml>
<bColl id="customerBean" bean="com.ibm.btt.bean.test.Customer"/>
<import file="data-import.xml"/>
<context id="customerCtx" type="test"><refKColl refId="customerBean"/></context>
Context ctx = ContextFactory.createContext("CustomerCtx"); ctx.setValueAt("name", "Steven");
<address.xml> <bColl id="address" bean="com.ibm.btt.importsupport.Address"/> </address.xml>
<customer.xml> <import file="address.xml"/> <kColl id="customer" dynamic="true"> <refData refId="address"/> <field id="customerID" value="customer12345"/> </kColl> </customer.xml>
<account.xml> <import file="customer.xml"/> <kColl id="account" dynamic="true"> <refData refId="customer"/> <field id="accountID" value="account12345"/> </kColl> </account.xml>
<loan.xml> <import file="account.xml"/> <kColl id="loan" dynamic="true"> <refData refId="account"/> <field id="loanID" value="loan12345"/> </kColl> </loan.xml>
<import file="loan.xml"/> Context definition in context.xml: <context id="loanCtx" type="test"><refKColl refId="loan"/></context>
Context ctx = ContextFactory.createContext("loanCtx"); ctx.setValueAt("account.customer.address.city", "Beijing"); ctx.setValueAt("account.customer.address.region", "AP-GCG"); ctx.setValueAt("account.customer.customerID ", "CUS00247"); ctx.setValueAt("account.accountID ", "ACC00369"); ctx.setValueAt("loanID ", "LOA00158");