Diploma 2014 2015 Catalin Ramascanu (PDF)




File information


Title: Autonomous and Dynamic Decision Engine
Author: © Catalin Ionut Ramascanu, University Politehnica of Bucharest, Faculty of Automatic Control and Computers

This PDF 1.5 document has been generated by pdfLaTeX / LaTeX with hyperref and classicthesis, and has been sent on pdf-archive.com on 30/09/2015 at 07:41, from IP address 109.150.x.x. The current document download page has been viewed 575 times.
File size: 613.8 KB (61 pages).
Privacy: public file
















File preview


AUTONOMOUS AND DYNAMIC DECISION ENGINE
˘ alin
˘
c at
ionu t¸ rama s¸ canu

A Rule Engine With More Support For Decision-Making
Bachelor Thesis
Computer Science and Engineering Department
Faculty of Automatic Control and Computers
University Politehnica of Bucharest
September 2015

[ September 8, 2015 at 21:51 ]

C˘at˘alin Ionu¸t Rama¸scanu: Autonomous and Dynamic Decision Engine, A
Rule Engine With More Support For Decision-Making, © September
2015
supervisors:
Ing. Tudor Scurtu
S¸ l.dr.ing R˘azvan Deaconescu
location:
Bucharest
time frame:
September 2015

[ September 8, 2015 at 21:51 ]

ABSTRACT

The demands of executing business rules on a given set of data are
various and frequent in computer applications. Typically, a software
component called rule engine is used to validate business rules at runtime. Even though most rule engines offer good performance for rule
validations and data analysis, there is no proper support for decisionmaking and they are not easy to configure or to deploy for particular
types of applications.
We propose in this thesis a new type of engine, which is not only
capable of rule validation but also of decision-making. We describe
the engine’s functionality, how input data, rules, decisions are represented and how easy it can be configured for the user’s needs. The
project aims to cover a wide variety of use cases, offering an innovative and dynamic solution for business rule validation.

iii
[ September 8, 2015 at 21:51 ]

[ September 8, 2015 at 21:51 ]

CONTENTS
1

2

3

4

5

introduction
1.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . .
1.2 Objective . . . . . . . . . . . . . . . . . . . . . . . . . . .
1.3 Thesis Overview . . . . . . . . . . . . . . . . . . . . . . .
existing rule-based solutions
2.1 Rule Engines in Java . . . . . . . . . . . . . . . . . . . .
2.1.1 Jess . . . . . . . . . . . . . . . . . . . . . . . . . .
2.1.2 Esper . . . . . . . . . . . . . . . . . . . . . . . . .
2.1.3 Drools . . . . . . . . . . . . . . . . . . . . . . . .
2.2 Rule Engines in C/C++ . . . . . . . . . . . . . . . . . .
2.2.1 CLIPS . . . . . . . . . . . . . . . . . . . . . . . . .
2.3 Rule Engines in JavaScript . . . . . . . . . . . . . . . . .
2.3.1 Nools . . . . . . . . . . . . . . . . . . . . . . . . .
2.3.2 Business-Rules-Engine . . . . . . . . . . . . . . .
2.4 Choosing the Right Rule Engine . . . . . . . . . . . . .
decision engine overview
3.1 Use Cases . . . . . . . . . . . . . . . . . . . . . . . . . .
3.1.1 Framework/Library . . . . . . . . . . . . . . . .
3.1.2 Stand-Alone Component . . . . . . . . . . . . .
3.1.3 Web Application . . . . . . . . . . . . . . . . . .
3.2 Engine Configuration . . . . . . . . . . . . . . . . . . . .
3.2.1 Input Definition . . . . . . . . . . . . . . . . . . .
3.2.2 Rule Definition . . . . . . . . . . . . . . . . . . .
3.2.3 Action Definition . . . . . . . . . . . . . . . . . .
3.2.4 Fetcher definition . . . . . . . . . . . . . . . . . .
3.3 Architecture . . . . . . . . . . . . . . . . . . . . . . . . .
3.3.1 Configuration Parser . . . . . . . . . . . . . . . .
3.3.2 Fetcher Manager . . . . . . . . . . . . . . . . . .
3.3.3 Web Server . . . . . . . . . . . . . . . . . . . . .
3.3.4 Output . . . . . . . . . . . . . . . . . . . . . . . .
3.3.5 Decision Engine . . . . . . . . . . . . . . . . . . .
decision engine implementation
4.1 Configuration Parser Module . . . . . . . . . . . . . . .
4.2 Output Module . . . . . . . . . . . . . . . . . . . . . . .
4.3 Web Server Module . . . . . . . . . . . . . . . . . . . . .
4.4 Fetcher Manager Module . . . . . . . . . . . . . . . . .
4.5 Decision Engine Module . . . . . . . . . . . . . . . . . .
decision engine results
5.1 Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.2 Comparison with Other Rule Engines . . . . . . . . . .
5.3 Configuration Analysis of the Adobe Prototype and the
Decision Engine. . . . . . . . . . . . . . . . . . . . . . .

1
1
2
3
5
5
5
6
7
9
9
10
10
12
13
15
15
15
16
16
16
17
18
20
25
27
27
27
27
27
28
31
31
33
35
36
36
39
39
41
42

v
[ September 8, 2015 at 21:51 ]

vi

contents

5.4 Web-Monitor . . . . . . . . . . . . . . . . . . . . . .
5.5 Usage as a Library . . . . . . . . . . . . . . . . . .
6 conclusion and future development
6.1 Conclusion . . . . . . . . . . . . . . . . . . . . . . .
6.2 Future Development . . . . . . . . . . . . . . . . .
6.2.1 Using ANTLR for Parsing Rule Condition
6.2.2 Including New Properties to Rules . . . . .
6.2.3 Enhanced Web-Monitor . . . . . . . . . . .
6.2.4 Class Based Input Data . . . . . . . . . . .
bibliography

[ September 8, 2015 at 21:51 ]

. . .
. . .
.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

44
46
49
49
49
50
50
50
50
53

LIST OF FIGURES

Figure 1
Figure 2
Figure 3

High-Level Diagram of the Architecture . . . .
Decision Engine Web Monitor . . . . . . . . . .
Data Insertion Through Web Monitor . . . . .

29
45
46

L I S T O F TA B L E S

Table 1
Table 2
Table 3

Test Scenarios . . . . . . . . . . . . . . . . . . .
Test Cases . . . . . . . . . . . . . . . . . . . . .
Engine Comparison Based on Features . . . . .

39
40
41

Input Configuration Using JSON . . . . . . . .
Input Configuration Using Java Code . . . . .
Rule Configuration Using JSON . . . . . . . . .
Rule Configuration Using Java Code . . . . . .
Print-Message Action Configuration . . . . . .
Send-Data-Via-Socket Action Configuration . .
Send-Email-Via-Smtp Action Configuration . .
Return-Value Action Configuration . . . . . . .
Return-Value Action Usage . . . . . . . . . . .
Custom Action Configuration . . . . . . . . . .
Fetcher Configuration . . . . . . . . . . . . . . .
Full Engine Configuration File . . . . . . . . .
Definition of the RuleJson Java Class . . . . . .
Rule Condition Parsing Algorithm . . . . . . .
The Implementation of Return-Value Action .
Implementation of URL Query Data Insertion
Initialization Logic of the Decision Engine . . .
Adobe Monitor Prototype Configuration . . .
Adobe Decision Engine Configuration . . . . .
Using the Decision Engine Java API . . . . . .

17
18
19
19
21
21
22
23
23
24
25
26
31
32
34
35
37
42
43
46

LISTINGS

Listing 1
Listing 2
Listing 3
Listing 4
Listing 5
Listing 6
Listing 7
Listing 8
Listing 9
Listing 10
Listing 11
Listing 12
Listing 13
Listing 14
Listing 15
Listing 16
Listing 17
Listing 18
Listing 19
Listing 20

vii
[ September 8, 2015 at 21:51 ]

[ September 8, 2015 at 21:51 ]

1

INTRODUCTION

Rule engines are very practical and effective
for their representational simplicity and optimized
performance, but their limited expressiveness and
web unfriendliness restrict their usability.
— Minsu Jang, Joo-Chan Sohn [6]
In the field of software development, it is often that a developer
is required to solve a problem that is just too fiddly for traditional
code, the logic of algorithm changes too often or is beyond any obvious algorithm based solution. For this type of problems, a rule-based
solution might solve all of the above issues. This solution is called a
Rule Engine and it is a component that is used to validate rules at
runtime. It is often used in order to be able to easily change rules
without having to recompile software.
However, even though most rule engine solutions offer good performance for rule validations and data analysis, there is no proper
support for decision-making and they are not easy to configure or to
deploy for particular types of applications.
We propose in this thesis a new type of engine, which is not only
capable of rule validation but also of decision-making.
In the following section we present the motivation for choosing to
build a decision engine, what are the objectives that we aim to achieve
and give a summary of the next chapters that follow.
1.1

motivation

The idea of the thesis was designed and implemented in collaboration
with Adobe Romania. One of the developing teams in the company
used a rule engine prototype software to monitor the state of their
product. The monitoring software was developed internally in Adobe
and it was designed to retrieve data from an external website, process
the data and display different alerts based on some predefined rules.
However, the prototype contained some limitations. It was complicated to configure, the configuration file required for setting up the
engine was difficult to understand and the team wanted the software
to also be able to perform other types of actions besides displaying
alerts.
Choosing a rule engine for building a monitoring software is a
good idea. Most programmers tend to use a rule-based solution when
implementing an algorithm or an application mostly because it is very

1
[ September 8, 2015 at 21:51 ]






Download Diploma 2014-2015 Catalin Ramascanu



Diploma_2014-2015_Catalin_Ramascanu.pdf (PDF, 613.8 KB)


Download PDF







Share this file on social networks



     





Link to this page



Permanent link

Use the permanent link to the download page to share your document on Facebook, Twitter, LinkedIn, or directly with a contact by e-Mail, Messenger, Whatsapp, Line..




Short link

Use the short link to share your document on Twitter or by text message (SMS)




HTML Code

Copy the following HTML code to share your document on a Website or Blog




QR Code to this page


QR Code link to PDF file Diploma_2014-2015_Catalin_Ramascanu.pdf






This file has been shared publicly by a user of PDF Archive.
Document ID: 0000304508.
Report illicit content