A model driven approach for bridging ILOG Rule Language and RIF Valerio Cosentino1,2 , Macros Didonet del Fabro3 , Adil El Ghali1,4 1 IBM France 2 AtlanMod, INRIA & EMN, Nantes, France 3 Universidade Federal do Paran, Brazil 4 Lutin UserLab, France valerio.cosentino@fr.ibm.com, marcos.ddf@inf.ufpr.br, elghali@lutin-userlab.fr Abstract. Nowadays many companies run their business using Busi- ness Rule Management Systems (BRMS), that offer: a clear separation between decision logic and procedural structure; the ability to modify a rulebase set rather than processes and the reusability of rules across applications. All these factors allow a company to quickly react and align its policies to the ever-changing market needs. Despite these advantages, different BRMSs can be found on the market, each of them implementing a proprietary business rule language (ex.: JBoss uses Drools, IBM uses Ilog Rule Language, etc.). Rule Interchange Format(RIF) is a W3C open standard aiming at reducing the heterogeneity among business rule lan- guages, which makes rules less reusable and interchangeable. Our work is focused on providing an implementation based on a Model Driven approach for bridging Ilog Rule Language to RIF. 1 Introduction The field of BRMS is characterized by a number of normative, open source, or proprietary systems and languages (Ilog JRules, JBoss Drools, etc.), allowing the expression of various solutions to business problems at a high abstraction level, but with heterogeneous sets of capabilities and languages. Rule Interchange Format (RIF [1]) and Production Rules Representation (PRR [2]) are two stan- dard proposals respectively developed at the W3C and at the OMG aiming at providing a level of standardization to the domain. An important difference be- tween RIF and PRR is that RIF is a standard for distribution of shared rules at runtime, whereas PRR is a standard for interchanging design-time rules. This work presents a case study of bridging a business rule language: the Ilog Rule Language (IRL) to a standard format: the Rule Interchange Format (RIF) and vice versa. We show how to make it possible with the help of Model Driven Engineering (MDE [3]). RIF is the W3C Rule Interchange Format and it is part of the infrastructure composing the semantic web. It is an XML language for expressing rules that computers can execute. One of the main goals of RIF is to promote a standard format to interchange rules between existing rule languages. Because of the serious trade offs in the design of rule language, RIF provides multiple versions, called dialects: – Core: it is the fundamental RIF language. It is designed to be the common subset of most rule engines – BLD: it adds to Core dialect logic functions, equality in the then-part, and named arguments – PRD: adds a notion of forward-chaining rules, where a rule fires and then performs some action (adding, updating or retracting some information) In this work we have implemented transformations for the Core and PRD dialects. An example of a RIF example is shown in (Fig. 1). Fig. 1. Example of a rule in RIF IRL is a formal rule language used inside WebSphere ILOG JRules BRMS. It supports the two different levels of a full-fledged BRMS: the technical level targeted at software developers and the business action language targeted at business users. The technical rules of JRules are written in IRL. The complete specification of IRL can be found in the JRules documentation [4] an example of an IRL rule is provided in (Fig. 2). Fig. 2. Example of a rule in IRL 2 Model Driven Engineering The primary software artifacts of the MDE approach are models, which are considered as first class entities. Every model defines a concrete syntax and conforms to a meta-model (or grammar, or schema), which defines its abstract syntax. One of the most common operations applied on models is transformation, which consists in the creation of a set of target models from a set of source models according to specific rules. In the work presented in this paper three main tools have been used: – Ecore allows to handle and create meta-models in Eclipse Modeling Frame- work (EMF) [5] – TCS (Textual Concrete Syntax) ([6],[7]) is a bidirectional mapping tool be- tween meta-models and grammars. It is able to perform both text-to-model (injections) and model-to-text (extractions) translations from a single speci- fication. TCS is used to map context-free concrete syntaxes to meta-models. – ATL (Atlas Transformation Language) [9] is a model transformation lan- guage specified as both a meta-model and a textual concrete syntax. It al- lows developers to produce a number of target models from a set of source models by writing rules that define how to create target models from source model elements. 3 Transformations The RIF2IRL transformation takes as input a RIF file, a BOM file (Business Object Model [4]) and a Dictionary model. The output generates an IRL model and the related IRL file, generated by a TCS parser. From the first input, using a TCS parser, a model conforming to an imple- mentation of the RIF meta-model is extracted. A BOM file is passed to the trans- formation to resolve the domain information declared inside the RIF file/model. The related BOM model is extracted out of the BOM file by a TCS parser and it conforms to the BOM meta-model implemented in [10]. A Dictionary is added as input parameter in the transformation in order to provide a translation from the element names declared in the RIF file to the corresponding ones appearing in the IRL file. The transformation has been implemented in ATL [8] and it defines how to convert RIF to IRL. The IRL2RIF transformation takes as input a IRL file and two BOMs and returns a RIF file. From the first input, a model conforming to the IRL meta- model is extracted by means of a TCS parser. The first BOM contains the information of the domain model, while the second one is used to map IRL functions to the built-in RIF functions for handling dates, numbers, strings, etc. The output is a RIF model, that is translated into a RIF file by a TCS parser. 4 The demonstration The IRL2RIF and RIF2IRL transformations will be first demonstrated using a set of simple examples (Appendix A) that illustrate the main functionalities of the transformation. We will then show a real world application of the transfor- mation using data from the Arcelor use-case studied in the ONTORULE project [11]. In the context of the Rule Xchanger application depicted in the (Fig. 3), we will focus on the transformation of IRL rule edited using JRules into RIF rules that will be executed using the Tight engine. Fig. 3. Rule Xchanger scenario 5 Conclusion The transformation we intend to demonstrate is a key component in the inter- operability between two rule languages that has been used in some real world applications such us the Arcelor use-case. it shows that rule application devel- oped using commercial BRMS such as JRules can be exported to other platforms that support the RIF standard. References 1. Rule Interchange Format http://www.w3.org/TR/rif-overview/ 2. Production Rules Representation http://www.omg.org/spec/PRR/1.0/ 3. Schmidt, D.C. Model-Driven Engineering. IEEE Computer 39 (2), Feb. 2006. 4. JRules documentation http://pic.dhe.ibm.com/infocenter/dmanager/v7r5/index.jsp 5. Eclipse Modeling Framework http://www.eclipse.org/modeling/emf/ 6. Textual Concrete Syntax http://wiki.eclipse.org/TCS 7. Jouault F., Bézivin J., Kurtev I., TCS: a DSL for the Specification of Textual Concrete Syntaxes in Model Engineering. In proc. of GPCE’06, Portland, Oregon, USA, pp 249-254 8. Atlas Transformation Language http://www.eclipse.org/atl 9. Jouault F, Allilaire A, Bézivin J, Kurtev I. ATL: a Model Transformation Tool. Sci- ence of Computer Programming 72(3, Special Issue on Second issue of experimental software and toolkits EST):31-39, 2008 10. Didonet Del Fabro M., Albert P., Bézivin J., Jouault F., Industrial-strength Rule Interoperability using Model Driven Engineering, Technical report 6747, INRIA, Nov. 2008. http://hal.inria.fr/docs/00/34/40/13/PDF/RR6747.pdf 11. Gonzalez-Moriyon G., Final steel industry public demonstrators, ONTORULE De- liverable D5.5, Jan. 2012 A Annex Fig. 4. Example 1 Fig. 5. Example 2