GENERATING RESTRICTION RULES AUTOMATICALLY WITH AN INFORMATION SYSTEM

Similar documents
Default Route de la configuración en el EIGRP

Moving-Object management method of combat system using main memory DBMS

1 Introduction. Computación y Sistemas Vol. 9 Núm. 1, pp , CIC-IPN, ISSN , Impreso en México. Abstract

Resumen. Una sola cámara Robot móvil Visión computacional Resultados experimentales

Revista de Topografía Azimut

CERTIFICACION SAGE Enterprise Management (X3)

Inyección de Dependencias en el Lenguaje de Programación Go

Querying Microsoft SQL Server 2014

Estrategia de Protección de Datos Cloud & DRaaS

Guidelines. Table of Contents. Welcome Letter

UNIVERSIDAD TÉCNICA DEL NORTE

Transition from EBNF to Xtext

A global fuzzy model for non linear systems using interval valued fuzzy sets

TÉCNICA DEL NORTE UNIVERSITY

Agenda: Estado Actual 2012

Programming Algorithms of load balancing with HA-Proxy in HTTP services

Procesamiento Analítico con Minería de Datos

Oracle OpenWorld: Labs for Oracle User Productivity Kit and Oracle Tutor Student Guide

Dyna ISSN: Universidad Nacional de Colombia Colombia

COMPILER DESIGN LECTURE NOTES

The Future of Business Depends on Software Defined Storage (SDS) How SSDs can fit into and accelerate an SDS strategy

A Data Mining technique for Data Clustering based on Genetic Algorithm

Classification and Generation of 3D Discrete Curves

A proposal to generate the method code based on class diagram and java meta-model 1

Aprovechando el valor de la Tecnología Flash. Fernando Ochoa, Senior System Engineer, EMC

Defining Program Syntax. Chapter Two Modern Programming Languages, 2nd ed. 1

ANX-PR/CL/ LEARNING GUIDE

Preparing for the ACW Languages & Compilers

Evaluation of the performance of coordinate measuring machines in the industry, using calibrated artefacts

Comparing Kanban, CONWIP, and Hybrid Pull Systems Comparación de Kanban, CONWIP y Sistemas Híbridos Pull

Diseño de un Datamart orientado al proceso de ventas usando la herramienta de Inteligencia de Negocios SQL Server 2014

" ANALYSIS OF ATTACKS ON WEB APPLICATIONS SQL INJECTION AND CROSS SITE SCRIPTING AND PRECAUTIONARY AND DEFENCE "

SELECCIONES MATEMÁTICAS

Manual De Adobe Photoshop Cs3 En Espanol File Type

Developing Applications with Java Persistence API (JPA)

A Content Based Image Retrieval System Based on Color Features

Journal of Applied Research and Technology ISSN: Centro de Ciencias Aplicadas y Desarrollo Tecnológico.

Appendix A: Syntax Diagrams

Overview: Multicore Architectures

Language Processors Chapter 1. By: Bhargavi H Goswami Assistant Professor Sunshine Group of Institutes Rajkot, Gujarat, India

Introduction The SELECT statement: basics Nested queries Set operators Update commands Table management

Mobile Broadband Caribbean & Central America

THE DYNAMIC MODEL OF A FOUR CONTROL MOMENT GYROSCOPE SYSTEM MODELO DINÁMICO DE UN SISTEMA DE CONTROL DE PAR POR CUATRO GIRÓSCOPOS

Automation of Semantic Web based Digital Library using Unified Modeling Language Minal Bhise 1 1

Inf 202 Introduction to Data and Databases (Spring 2010)

CS 415 Midterm Exam Spring 2002

CS Compiler Construction West Virginia fall semester 2014 August 18, 2014 syllabus 1.0

Model for semantic processing in information retrieval systems

PHP PROGRAMMING PATTERN FOR THE PREFERENCES USABILITY MECHANISM

Computing Inside The Parser Syntax-Directed Translation. Comp 412 COMP 412 FALL Chapter 4 in EaC2e. source code. IR IR target.

Release Notes & Installation Instructions Medtech Evolution Specialist

Propedéutico de Programación

Lecture 09: Data Abstraction ++ Parsing is the process of translating a sequence of characters (a string) into an abstract syntax tree.

Sesión 2: PL 1b: Gestión de sistemas en tiempo real para prototipado rápido de controladores (MathWorks).

Novedades en Delphi XE

Configuración del laboratorio de acceso telefónico de clientes (San José, Estados Unidos)

Package edu.internet2.middleware.shibboleth.aa

IBM InfoSphere MDM Reference Data Management V10

NeOn Methodology for Building Ontology Networks: a Scenario-based Methodology

AN INTRODUCTION TO VERILOG HDL

Programming Languages Third Edition

Syntax. A. Bellaachia Page: 1

With its speed and variety of information treated would Big Data end Data warehousing?*

Language engineering and Domain Specific Languages

WSEAS TRANSACTIONS on INFORMATION SCIENCE and APPLICATIONS. A Web Mining System

DOC - MANUAL DE ACTIONSCRIPT

PROGRAMACIÓN ORIENTADA A OBJETOS

Part 5 Program Analysis Principles and Techniques

CST-402(T): Language Processors

TRABAJO FIN DE GRADO

Modeling Complex Mobile Web Applications from UI Components Adding Different Roles and complex Database Design

Strain Analysis for Different Shape Factors in Indentation Processes

Integration Ontology for Distributed Database

CMSC 330: Organization of Programming Languages. Context Free Grammars

WP3 Technologies and methods for Web applications

copyright 1996, 2001, 2005 R.S. Pressman & Associates, Inc.

Plan. Language engineering and Domain Specific Languages. Language designer defines syntax. How to define language

UNIT -2 LEXICAL ANALYSIS

CHAPTER 1. Topic: UML Overview. CHAPTER 1: Topic 1. Topic: UML Overview

Best practices of interoperability among heterogeneous software systems: a Semat-based representation

RESUMEN DE TESIS DOCTORAL. Un algoritmo general para la descomposición semántica de geo-imágenes

COMPILER CONSTRUCTION LAB 2 THE SYMBOL TABLE. Tutorial 2 LABS. PHASES OF A COMPILER Source Program. Lab 2 Symbol table

Analyzing downloaded data from road side units

Oracle Pl Sql For Students

PLN Curs Partial exam. A possible solution is the following:

Security Issues Formalization

XSCoRe: A Program Comprehension Workbench

Documentación GT_Complemento_Exportaciones xsd Factura Electrónica en Línea

Plane-and Space-Filling Trees by Means of Chain Coding

A Prototype of Description Language for the Two-Hemisphere Model

MICROSOFT Course 20411: Administering Windows Server 2012

Letter. Activity. Tips. Use sides and angles to name this quadrilateral.

IntesisBox TO-RC-xxx-1 Toshiba compatibilities

White paper for Blockchain Database Application Platform ChainSQL

[FILE] JAVA INTELLIGENCE SERVICE MANUAL EBOOK

C O M P U T E R S C I E N C E S U P P O R T G U I D E F O U R T H G R A D E T H I R D T E R M

Code Query to Support Program Structure Understanding

Using Scala for building DSL s

RISC Processor Simulator (SRC) INEL 4215: Computer Architecture and Organization Feb 14, 2005

Identify Three-Dimensional Shapes from Different Views. This is how we will be identifying a three-dimensional shape using different views.

Transcription:

GENERATING RESTRICTION RULES AUTOMATICALLY WITH AN INFORMATION SYSTEM M.Sc. Martha Beatriz Boggiano Castillo, Lic. Alaín Pérez Alonso, M.Sc. María Elena Martínez del Busto, Dr. Ramiro Pérez Vázquez, Dra. Luisa González González mbeatriz@uclv.edu.cu;apa@uclv.edu.cu; mmbusto@uclv.edu.cu; rperez@uclv.edu.cu Universidad Central Marta Abreu de las Villas. Cuba ABSTRACT Information systems design problems due to informal treatment of requirements have led to consider the way requirements are handled as essential factors, currently assembled as business rules. The purpose of this work is to generate restriction rules automatically with an information system, specifically those that may reside in the database, gaining flexibility, transparency and cost reduction in business. This paper also describes some benefits of using business rules. A pattern was used for rules, analyzing resources that made possible their implementation in a database and determine their form of storage. This pattern of rules was modified, adapting it to new rule requirements. Database resources were chosen to implement them, and a compiler that generates this code was built. KEYWORDS Business rules, automatic code generation, restriction rules RESUMEN. Los problemas en la concepción de Sistemas de Información, debido al tratamiento informal de los requerimientos, han permitido considerar como factor de esencial importancia la forma en que se manejan los requisitos, enfocados actualmente como reglas de negocio. El propósito de este trabajo es generar automáticamente las reglas de restricción en un sistema de información, específicamente aquellas que puedan residir en la base de datos ganando con esto agilidad, transparencia y reducción del costo en un negocio. Se describen algunos beneficios de usar reglas de negocio. Se usa un patrón para estas reglas, analizando los recursos que posibiliten su implementación en una base de datos y determinar su forma de almacenamiento. Se modifica un patrón de reglas adaptándolo a las nuevas exigencias de las reglas, se eligen los recursos de bases de datos para implementarlas, y se construye un compilador que genere este código PALABRAS CLAVES Reglas de Negocio, generar código automáticamente, reglas de negocio de restricción

1. INTRODUCTION. Nowadays, many information system specialists consider that the starting point of requirement identification is business rule design. These rules can be considered as sentences that allow the expert users to define policies, knowledge and conditions of the business in small, isolated units. Part of the requirements, that are currently focused as business rules, have been traditionally implemented by the developer by hardcoding them in the source code of the program, in database mechanisms or both. By automating this process, failures are avoided and in this way time and cost are significantly reduced. In order to automate these "requirements" a system is needed to give them functionality so that they are implemented in a given language and stored for safe handling. Current studies tend to store the rules in a repository where they are handled by an independent engine rule. Therefore, restrictions are not codified in the system and this can only make necessary accesses to the repository. The idea of business rules, as a definition of the desired policy, would provide a solution for its possible treatment in databases and the benefits it provides. There are several potential advantages of using Business Rules. Of all, according to Lowenthal (Lowenthal, 2005), the three most important are: Agility: simple and rapid response to the dynamic requirements Cost Reduction: low cost to create or update the parts of applications that implement the business. Business policies Transparency: the rules easily allow the auditing that the software services carried out in their respective business policies 2. IMPLEMENTATION OF BUSINESS RULES There are many types of business rules. Due to their complexity and diversity, authors tend to group classify them according to different points of view. One of these classifications is was given by Solivares, Lowenthal, Morgan (Perez, Boggiano 2007). These classifications were analyzed and Morgan s classification was finally adopted in this paper since it takes into account a more elaborate classification of rule patterns, and therefore it was considered the most suitable of all. According to Tony Morgan ( Morgan, 2002), the most convenient way to create rule sentences is by selecting appropriate patters from a short available list. For example: <sentence>: <Subject> should < restriction>. Morgan adds that there is no standard about how to do business rules but it is possible to give some recommendations. The pattern rules could reflect the forms and types of problems that an automated system intends to negotiate. Morgan provides several kinds of rules such as Restriction, Classification, Calculation and Numbering. Of all these, the present paper focuses on the restriction type. The restriction rules are those restricting the data in the system and they may overlap with the rules of the data model, since those also prevent the introduction of erroneous data. The difference lies on the fact that the restriction rules determine the value attributes or properties of an entity beyond the basic restrictions. The rules can be implemented in different ways and even there could be different techniques for the same rule. Morgan (Morgan, 2002) shows some of them: Programming Languages, Scripts, Database. We have found that many of the business rules fit more naturally within the database, where they can have more direct contact with the data (Mota, 2005). The technology types most commonly used are Oracle, SQL

Server and Postgres. Other correlative database products have widely similar capabilities, so it is not difficult to apply this research to other languages. In the case of SQL Server, programming can be made in a dialect called Transact-SQL. The most usual procedure is to use business rules in respect to functional words around the basics (CREATE, READ, UPDATE and DELETE). These mechanisms are common to all data services: restrictions (Constraints) CHECK, trigger, views, user-defined functions and assertions. Here we are working with triggers and functions in order to implement the restrictions rules on the business database. The pattern suggested by Morgan for the basic restricting rule is the following: <determinant> <subject> [no] (must have) <characteristics> [(If unless) <fact>]. This is the most common pattern for business rules; it provides a restriction on the subject of a rule. It was decided to make changes for improving it and adapting it to the needs so as to obtain tangible effects. The resulting pattern of restriction is given below (holding its conventions): <determinant> <subject> (can not have <characteristics>) (<characteristics> can have <characteristics> only if <facts>). Element <determinant> <subject> <characteristics> <facts> Meaning It is the determinant for each subject, for example: One, Two, She, He, Every, All, according to the best meaning of the written text It is an element of the business database such as entities and objects. The entity can be qualified by other attributes descriptors, such as the existence in a particular state or linked to a specific application of the rule. It describes the characteristics of the subject in the business, both internal and others related with other entities. They are facts related to the state or behavior of the business database, including or not including the subject Table.1 Elements of Pattern. The conventions used for the patterns in this work are as follows: Parentheses () They hold a group of items. Brackets [] They enclose optional elements. Vertical Bar It separates alternative terms. Angle brackets <> They hold special terms as those shown in the table below. 2.1. A case of basic restriction and list of restrictions. We present a rule of business for a kidney transplant. Natural Language:

A patient can not take potential donors with more than 4 physical exams or have in his evolution a higher maximum temperature of 42 degrees. To achieve simple rules and easy to maintain, trying to separate them into smaller rules as possible, it is Natural Language: A patient can not take potential donors with more than 4 Physical Exams. A patient can not have a maximum temperature of 42 degrees. This way of expressing this rule very close to the customer is called natural language, taking into account the pattern adopted. In order to achieve an SQL implementation, an intermediate representation is considered (called the technical language); to represent the rule in technical language, the representation of the rule is used, where the navigational point is used (Morgan, 2002). This style is used in the technical language to access the attributes of the entities and browse the relationships between them. Simple access to an attribute: Entity_1.Attribute. Browse between entities relationships: Entity_1.Entity_2. (...). Entity_n.Attribute. For example, if one needs to access the patient's name, it can be reached by writing Patient.Name. However, it is also possible to browse it in the relationships of the following schedule: Ilustration 1 Portion of E / R Schedule for Kidney Transplant When using the notation point navigation to establish the relationships between entities and accessing their attributes, two main types of results could be obtained, due to the cardinality between the business objects. This is because it can be specified either as a single member of the business or referred to a set of them and therefore it is necessary to discern between both cases. Multiple elements: By stating "The Patient's evolutions..." (Patient.Evolution) several evolutions related to a unique patient are designed as shown in the cardinality of the diagram. Note again that the order of the notation is very important. An expression of a rule in technical language would be: A patient can not take sizeof (Evolucion.idEvolucion)> 30 <Subject>: Patient

<Characteristics>: Sizeof (Evolucion.idEvolucion)> 30 In natural language the corresponding expression to this rule would be: A patient can not have more than 30 evolutions. 2.2 The Triggers and functions in implementing the rule. It is significant to reach a consensus on when you should use the various resources of SQL99, according to the peculiarities of the rule and how such restrictions of the business will be implemented. This will provide a tool to select the form of generating the rule. Applying rules of restriction patterns in a database for kidney transplant. For Example 2 A nephrologist can assist more than 12 patients only if the number of patients is greater than 50. With technical language: <Subject> Patient <characteristics> sizeof(patient.idpatient)>12 <fact>: sizeof(patient.idpatient)>50 The code generator will produce in the SQL Server database of the business of kidney transplant the following function and trigger: The function: CREATE FUNCTION FRN#0 (@iddoctor Integer) RETURNS BIT AS BEGIN DECLARE @result BIT SET @result = 0 IF ( (SELECT COUNT (b.idpatient) FROM Nephrologist a, Patient b WHERE (@iddoctor = a.idnephrologist) AND (a.idnephrologist = b.idnephrologist)) > 12) IF NOT ( (SELECT COUNT (a.idpatient) FROM Patient a) > 50) SET @result = 1 RETURN @result END The trigger: CREATE Trigger TRN#00 ON Patient AFTER INSERT, UPDATE AS DECLARE @subject INT SET @subject = (SELECT a.idnephrologist FROM Nephrologist a, Inserted b WHERE (a.idnephrologist = b.idnephrologist)) IF dbo.frn#0(@subject) = 1 BEGIN RAISERROR('RN#0',16,1); ROLLBACK TRANSACTION; END These triggers, as can be noted, state a @subject that is the conditioned <subject> to the rule, which is extracted through a query defined by the point notation. Afterwards, in a conditional sentence it is questioned whether the rule is shattered or not to the specified subject on whom a relational modification was done; if so, then suitable measures are adopted.

The function is the body of the rule. Triggers will refer to a function. This is the one responsible to perform the body of the rule where it is verified if the subject breaks the conditions imposed by the restriction. Its objective is to reply if any of the prohibitions is infringed by using a Boolean value. The function FRN#0 is called from the trigger. 2.3 Implementation, operators and functions. The process of compiling business rules, restriction type, used in the current version of an editor of rules in technical language is performed since the first moment you execute. During this process part of the resulting code is being directly generated and the rest is formalized in the corresponding application. This compiler is composed of two other compilers, one of these is engaged in compiling the <characteristics>, and the other is engaged in the <facts>. The compilation process is shown in this activity diagram: llustration 2. Diagram in the Collection Activity or translation. The compiler was made in the software Parser Generator v1.12 with Lex and Yacc for Delphi. Patterns of coincidence in codes are created With Lex. The patterns are specified using regular expressions, each of these has a corresponding action associated to them. When a string that matches the regular expression is found, the corresponding action is done. With Yacc, given the BNF (Backus Normal Form) of grammar specification, the corresponding parser can be generated. Yacc does not accept every grammar presented; however, the kind of grammar that it accepts is generally powerful and enough for the needs of programming (Bumble-Bee, 2000). In Lex it is mainly defined the data types, the operators and the functions that are accepted in the technical language; they are useful for shaping the grammar of the rule, restriction type. Only triggers and functions are generated. Efforts are being made to improve this compiler, to represent CHECK restrictions, to do a rigorous check type and to evaluate the repercussion of the business rule transformation in the business database.

Currently, the software is being validated to implement a set of business rules to the problem of kidney transplant in an SQL Server database and work is being done on a version of the MySQL 5.x software database 3. CONCLUSION This article has addressed the need to deal with the requirements of the system using the approach of business rules, showing their dominance in the process of managing the organization in order to have a potential for a drastic reduction in the number of errors. Business rules, classified as restriction types, are formalized in a pattern of rules of business, based on the pattern proposed by Morgan. A program that compiles these rules was built and used starting from entries of the rules in technical language. Using the navigation point in which the rule entries in the pattern were made considerations were adopted for each part of this pattern and a trigger was automatically created for insertion and update which implements a restriction rule to a information system SQL Server 2000 database. Also examples are presented for a database of kidney transplants. This compiler will be valid for any business using a business database in SQL Server 2000. Automation to generate business rules helps to avoid failures, achieving significant reductions of time and cost. REFERENCES REFERENCES Book MORGAN, T. (2002) Business Rules and Information Systems: aligning IT with Business Goals. Addison Wesley.Chapter 3. Defining Business, 2002. DEMUTH, B., HUSSMANN, H. & LOECHER, S. (2001) OCL as a Specification Language for Business Rules in Database Applications. UML'01 4th Intl. Conf Unified Modeling Language,. Toronto, Ontario, Canada, October 2001. Journal MOTA, S. A. (2005) Active Databases. BESEMBEL, I. M. & CHACÓN, E. Objetos y reglas de negocios en la integración y automatización de procesos de producción continua. Universidad de Los Andes. GIDyC. Departamento de Computación. pags 12. Mérida. Venezuela. 5101. Electronic Article. PEREZ, BOGGIANO (2007) Aplicación para reglas de restricción en negocios. Universidad Central de Las Villas. Facultad de Ciencias de la Computación.Trabajo de Diploma. Año 2008. p. 18-21 BUMBLE-BEE (2000) Parser Generator 1.12 ed. Software. http://www.bumblebeesoftware.com/release.doc