| With the rapid development of computer technology and the growing maturity of e-commerce technology,the way of trade,has having some great changes.A new trade-barter has created from the traditional way trade,which is based on a professional e-commerce platform,and able to realize the exchange between goods(or service)between goods(or services).The transaction does not pass through the cash settlement,and it can be carried out between enterprises.In the field of barter industry,because it’s trade rules are always changeful,the barter currency joined increases the complexity of electronic barter trade rules and the risks of electronic barter market.Obviously,this problem will lead that it must be more and more difficult to develop an electronic barter transaction platform,and a mass of time and money is being used in the software requirements changes frequently.To solve this problem,it requires developers to design the barter system with better logic structure to adapt to this fast changing demand,and realize the high-speeding development and reduce maintenance costs.Taking business logic and business data apart is the core idea of the rules engine,which separates business rules from codes,so that they can be maintained as an independent module.When business rules change,it only need business people update the rules files,while other part can stay the same.At first,this paper introduces the concept of barter and rules engine;After that,from several areas which contain module structure,rules engine working mechanism,the establishment and running process and the rules writing,this paper introduces the open source project JBoss Drools rules engine;Then,the paper analysis and design two important module business model of the barter system-the signing of commission contracts and the proceeding of barter trades;Next,the paper clearly analyzes the business requirements of the two core modules,and designs the key facts object and detailed business and state conversion processes;then,we can apply the Drools rules engine technology into the barter system.while based on already existing transaction processes,we write rules files,which can be deployed to achieve:At the first step,the rule files are compiled,and the compiler will generate the rule base by package after they are compiled pass;At the second one,the rule engine will load the rule base associated with the business objects to work memory,then read the objects and match them with the rules in the rule base.The rules matching facts successfully will be placed in the agenda,and engine may execute the rules in the agenda to make business decisions,so that the paper has achieved the creation and reasoning of rules files.Through the actual research and application,this paper summarizes the rules engine produces a significant effect on software development process.The application of rules engine in barter transaction systems is still in the initial stage of exploration,so this paper is a tentative research and application which has some reference value. |