1、 BUSINESS RULE ENGINE-BASED FRAMEWORK FOR SaaS APPLICATION DEVELOPMENT Zhang Xiuwei1,2,3, He Keqing1, Wang Jian1, Wang Chong1and Li Zheng11State Key Lab of Software Engineering, Wuhan University, Wuhan, China 2Computer School, Wuhan University, Wuhan, China 394005 Troops of PLA, Jiuquan, China xiuwe
2、izhang, wangjian_sd, , hekeqing, Keywords: Business Rule Engine, SaaS, Multi-tenancy, Personalized Customization. Abstract: Software as a Service (SaaS) is becoming a new direction of software industry in the new cloud computing era. In order to satisfy business policy changes and personalized requ
3、irements from different tenants in SaaS applications, business rule management must support multi-tenancy and online customization. This paper proposed a framework based on business rule engine, decoupling of business logic rule from SaaS application, which makes SaaS application more robust and mai
4、ntainable. It takes business rule as an independent and online maintainable part of SaaS application, which could allow tenants to safely upgrade, delete or create rules during runtime. Finally, a practical case study of absence approval-process in attendance management system evaluates the effectiv
5、eness of the framework. 1 INTRODUCTION With the emergence of Cloud Computing and maturity of Service Oriented Architecture (SOA), the SaaS delivery model has gained popularity, due to advantages such as lower start-up cost and reduced time to market. A SaaS vendor owns and takes the responsibility o
6、f maintaining a single application for multiple tenants who may have similar but also varying requirements (Kapuruge, et al., 2011). The service vendor delivers software functionalities with one single instance software application running for all of its tenants. The most ideal case for SaaS vendors
7、 is that every tenant feel comfortable using a completely standardize offering. However this ideal case usually does not happen in enterprise software application area. Normally, this one instance is used by different tenants having different personalized requirements in terms of data, process rules
8、, and business rules (Kwok, et al., 2008). Typically, business data and logic integrate with other functionalities. In SaaS application, configurability, multi-tenancy and scalability are the three key attributes to evaluate the maturity of SaaS application. In todays business environment of relentl
9、ess change, software configurability is inevitable since changes generated by business policies and operations need to be propagated onto the support software application. A software system is directly related to the business system within which it operates and is thus a manifestation of some busine
10、ss requirements for operational control and support of decision making (Wan-Kadir and Loucopoulos, 2003). Typically, business rules have been bundled in program code or in database structures, so it is very hard to upgrade. No matter in large enterprises or small and medium enterprises (SME), the bu
11、siness rules change very fast and need to be adjusted timely. Business Rule Group (BRG) believes that rules are a first-class citizen of the requirements world. Traditional information management systems for business process configuration are not easy to maintain and are difficult to expand. This pr
12、oblem becomes increasingly prominent. There may even be a situation where business rules changes can cause the entire system to change (Liu, et al., 2010). In SaaS application, many tenants are running on one instance with the availability of 24*7. It is unimaginable to modify or upgrade the busines
13、s rule for one tenant by suspending the whole application. Meanwhile, it is a horrible disaster for one tenant to modify its own business rules and affect other tenants rules. In order to dealing with this kind of 345situation, the SaaS applications business rules need to be customized with a flexib
14、le method, which enables organizations of any size to build, execute, manage, and evolve its own rule-oriented applications. A rule engine can be viewed as a sophisticated interpreter of if-then statements. It can reach a conclusion from a set of facts feed into it and trigger an appropriate action.
15、 So we can use the characteristic of rule engine to separate the business logic out of the SaaS application to support online customization and multi-tenancy with the isolated rule file with specific tenant who has personal customization of business rules. Therefore rule independency and isolation i
16、s an essential part in the development of SaaS application. In this paper, a business rule engine-based framework was proposed to help the development of SaaS application with the personalized customization of business rules, which is convenient for tenants to change the business rules on-the-fly an
17、d minimize the downtime of the application during the business rule upgrading or modification. In this paper, we only focus on the business rules online customization and multi-tenancy support, other parts customization like process data, UI elements, localization, performance monitor and so on are
18、out of the scope. The next section identifies the related work and section 3 provides a clear and concise description of the background. Section 4 demonstrates our framework and provides explanation for our framework. Section 5 presents the implantation representing our case study and is used to exe
19、mplify the potential of our approach. Section 6 draws conclusions from our work and identifies the possibilities for future work. 2 RELATED WORK Business rule customization of software is not a new issue. And many researchers have done a lot in traditional applications. Initially, rule based softwar
20、e tools originate from work carried out in the artificial intelligence (AI) research community. Companies were faced with the need to combine domain expertise with the flexibility to write lots of “if x, then y” statements over a wide range of variables without resorting to spaghetti code (Gichahi,
21、2003). Orriens (2003) and Vasilecas (2009) have two main views in dynamic business rule driven software system design. One of them is to design predefined executable processes and execute them by using rules in software system, where processes and execution rules are derived from business rules usin
22、g transformations. And another one discussed in the work (Vasilecas, 2009), where business rules and facts describing current business system state are loaded into inference engine of the software system and transformed into software system executable data analysis process according to the results o
23、f logical derivations. Computer scientists and programmers began developing rule languages and the corresponding engines that could handle the conditions and actions needed to satisfy the wide range of rules. The most successful approach for doing this has proven to be the Rete algorithm (Forgy, 198
24、2). Many rule-engine tools and application development support environments was applied like Blaze Advisor Builder, BRS RuleTrack, Business Rule Studio, Haley Technologies, ILOG Rules, Platinum Aion, etc (Karami and Iijima, 2010). In SaaS applications, there are still lots of differences in business
25、 rule customization with traditional applications. These differences include: z The business rule customization or configuration for SaaS applications should support multitenant architecture and each tenant should have their own customization. z Not to affect other tenants, SaaS providers could not
26、suspend the system when some tenant wants to modify or upgrading the business rules. z The customization will be executed by administrator of tenant, not by developers of SaaS provider. z The customization of the business rules should be simplified and friendly. Above mentioned differences between S
27、aaS applications and traditional software have raised many researches in this new area. Guo (2007) proposed a multi-tenant supported framework to support better isolations among tenants in many aspects such as security, performance, availability, administration etc. Zhang (2007) proposed a SaaS-orie
28、nted service customization approach, which allows service vendors to publish customization policies along with services. If tenants customization requirement is in agreement with policy after being verified, vendors will update service accordingly. This approach will inevitably burden service provid
29、ers because of tenants reasonable customization requirement increments. Gong (2009) developed ECA process orchestration architecture to create flexible processes. This architecture based on both knowledge rules (separating knowledge from processes) and event-condition-actions (ECA) mechanisms to pro
30、vide the highest level of flexibility. Configurability of SaaS CLOSER2012-2ndInternationalConferenceonCloudComputingandServicesScience346issue was addressed in Ref (Nitu, 2009) who researched the configurability like user interface, workflow, data and access control from the different aspect of SaaS
31、. From the customization and configuration perspective, Sun (2009) explored the configuration and customization issues and challenges to SaaS vendors, clarifies the difference between configuration and customization. A competency model and framework has been developed to help SaaS vendors to plan an
32、d evaluate their capabilities and strategies for service configuration and customization. In the Ref (Shi, et al., 2009), a flexible business process customization framework for SaaS was proposed to solve problems caused by orchestrating SaaS business process through BPEL specifications. Kapuruge (2
33、011) discussed the challenges arising from single-instance to multi-tenancy, and presented an approach of Serendip4SaaS to define business processes in SaaS applications. To the best of our knowledge, no related work has combined the rule engine and decision table with the SaaS application for multi
34、-tenancy support and online customization. Compared to them, our work was focused on the perspective of business rule customization and configuration. In our framework, each tenant can update their personalized business rule in SaaS application by online selecting and modifying corresponding rules.
35、Rule engine was utilized as the essential part to improve the flexibility and multi-tenancy for SaaS application, which makes business rule as an independent and maintainable part of application. 3 BACKGROUND 3.1 Business Rule Engine In business, a lot of actions are triggered by rules: “Order more
36、ice-cream when the stock is below 100 units and temperature is above 25 C”, “Approve credit card application when the credit background check is OK, past relationship with the customer is profitable, and identity is confirmed”, and so on. Traditional computer programming languages make it difficult
37、to translate this “natural language” into a software program. Business rule engine enables anybody with basic IT skills and an understanding of the business to turn statements as running computer code (Browne, 2009). A business rules engine is a software system that executes one or more business rul
38、es in a runtime production environment. It will test data objects quickly in the workspace, pick out rules which meet requirement from loading rule sets, and generate an instance of rule execution. Figure 1 shows the architecture of rules engine. Pattern matcher decides which and when rules will be
39、implemented. The implementation sequence of rules picked from pattern matcher is arranged in agenda so that execution engine can execute the rules or other actions in order. The underlying idea of a rule engine is to externalize the business or application logic. Business rules are expressions that
40、describe and control the processes, operations and behaviour of how an enterprise, and the applications that support it, performs. Rules assert influence over business or system behaviour by recommending actions to be undertaken. A rule provides its invoker a directive on how to proceed. Further, ru
41、le policies provide a generalized mechanism for specifying frequently changing practices, freeing system components from the burden of maintaining and evaluating evolving business and system environments (Jeng, et al. 2004). Agenda Pattern Matcher (RETE) FactsWorking MemoryKnowledge BaseAction Facts
42、 Rules Rule Engine Figure 1: Basic architecture of rule engine. 3.2 Decision Table A decision table is a tabular representation used to describe and analyze decision situations, where the state of a number of conditions determines the execution of a set of actions. Many variations of the decision ta
43、ble concept exist which look similar at first sight (Vanthienen, 2009). Decision tables are best suited for representing business rules that have multiple conditions. Adding one condition is done by simply adding one row or column. Like the if/then rule set, the decision table is driven by the inter
44、action of conditions and actions. The main difference is that in a decision table, the action is decided by more than one condition, and more than one action can be associated with each set of conditions. If the conditions are met, then the corresponding action or actions are performed (Vasilecas, 2
45、006). A column in the entry portion of BUSINESSRULEENGINE-BASEDFRAMEWORKFORSaaSAPPLICATIONDEVELOPMENT347the table is known as a rule. Values which are in the condition entry columns are known as inputs and values inside the action entry portions are known as outputs. Outputs are calculated depending
46、 on the inputs and specification of the program. Figure 2 depicts the basic principle of the decision table. Decision rules for the case (Decision Logic) Some case requiring a decision (Inputs) Making Decision Outcome for the casePotential outputs Figure 2: The basic principle diagram of decision ta
47、ble. 4 FRAMEWORK The SaaS application operating on the proposed SaaS platform is one packaged business application with web-based user interface to multiple tenants. Based on the features of business rule engine, we design and implement a framework for development of SaaS application with an online
48、business rule customization. The architecture of framework is shown as Figure 3. The essence of this framework is to separate business logics and business rule, and make the business rule as an independent and maintainable part, support multi-tenancy. The objective of this framework is to reach a fl
49、exible and competitive scenario in which it would be easier and faster to react when changes in demand or business appear. Visual Rule Definer (like Guvnor) Rule Converter (DSL File) SaaS Application SaaS Operation Platform PaaS Business Logic Layer IaaSTenant A Tenant B Tenant C Platform AdminRule EditorA EditorB Rule File Set Rule Engine Rule Metadata Rule Repository Deploys Spcifies Figure 3: The business rule engine-based framework. 4.1 Basic Units of the Framework The proposed framework includes the following major inter