<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>SBBRENG: Spreadsheet Based Business Rule Engine</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Pablo D. Palma</string-name>
          <email>pablo.palma@incentings.com</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>General Terms Documentation</institution>
          ,
          <addr-line>Design, Security, Human Factors, Languages. Verification</addr-line>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Incentings Latadia 4623</institution>
          ,
          <addr-line>Santiago</addr-line>
          ,
          <country country="CL">Chile</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>We developed a software product to replace the use of spreadsheets as a data processing solution within a specific business area. This paper explains the characteristics of the tool and the findings, both resulting from a process of 3 years real life refinement inside the ICM domain, and that we postulate can be valid in other business domains.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Spreadsheet</kwd>
        <kwd>Business Rules Engine</kwd>
        <kwd>DDD</kwd>
        <kwd>SEmS'14</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. INTRODUCTION</title>
    </sec>
    <sec id="sec-2">
      <title>1.1 Use of spreadsheets for ICM solutions</title>
      <p>The last four years our company has been working in the field of
Incentive Compensation Management –ICM-. Current solutions,
based on calculating performance-based payment for employees,
are complex and highly dynamic.</p>
      <p>
        Worldwide, “only a 10% of sales organizations with more than
100 payees deploy prepackaged sales ICM applications” [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ].
Almost all the remainder uses Excel. This is a reaction to the
combination of factors: high rate of change, short time available
for implementation, and typically long cycles in IT development.
However, Excel introduces its own limitations. It requires a lot of
human intervention that results in overpayment, and
usergenerated errors that could be reduced “by more than 90%” [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]
(see subsection 5.2). In addition, there is “dissatisfaction with the
reliability of spreadsheets in adequately supporting compensation
processes” [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. Excel also does not accomplish auditing,
accounting and regulation requirements.
      </p>
      <p>In our market, the most important features of ICM software are
flexibility, security, auditing capabilities, and allowing the end
users to update the product themselves by including changes in
business rules.</p>
    </sec>
    <sec id="sec-3">
      <title>1.2 Goals for a new ICM software</title>
      <p>Some or the issues of pre-existing ICM solutions are:
 World Class ICM software solutions are costly and demand
long implementation processes
 In-house developments are slow1 and rigid2
1 in the range of 2 hrs per 2.000 transactions


</p>
      <p>Excel-based solutions are fragile, difficult to audit and error
prone3
Currently available solutions don’t attempt to improve
problem representation4 beyond conventional system
documentation
Excel formulas are one-line expressions and are thus difficult
to read (e.g. nested if statements)</p>
    </sec>
    <sec id="sec-4">
      <title>1.3 Importance and state of our work</title>
      <p>There are two elements we consider important. First, we are
putting in practice some ideas (see Section 8) that may be useful
in other areas of enterprise software development. Second, we
want to determine how well our selection of functionalities
succeeds in creating a tool that best takes advantage of a mental
model of spreadsheets.</p>
      <p>Customized ICM applications developed with SBBRENG have
been in use for more than a year in several companies from
different areas: car dealerships, banks, retail, etc. This happens in
the Chilean market where we use the product name IM4</p>
    </sec>
    <sec id="sec-5">
      <title>2. BUSINESS RULES ENGINE</title>
      <p>
        Business rules engines aren’t a new product category, they started
around the 80s [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. Since then, many products and companies
have undergone a cycle of creation, development, merging and
death. We will use two currently successful solutions as
comparison standards: Drools (see Drools Guvnor Knowledge
Base)5 [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] -a component of the open source platform JBoss
BRMS- and ODM [
        <xref ref-type="bibr" rid="ref3 ref4">3, 4</xref>
        ] by IBM. Both are much larger systems
than SBBRENG, sharing the same global objective: make the
application more business agile.
      </p>
      <p>Drools is a low level programming environment oriented to
efficiently manage a large quantity of conditions of any type. It
provides APIs for integration with other languages, tools and
processing environments. On the other hand, Operational
Decision Management –ODM- is a more business oriented
solution that conceptually splits systems into two different
components, talking to each other under a data contract. One is a
traditional Data Processing System for storing, updating and
reporting information related to some business domain, and the
other is a specialized system for managing and executing the
business rules of the same business domain.
2 no provisions for isolation or special management of business
logic
3 http://eusprig.org/horror-stories.htm
4 problem representation has impact on the maintenance agility
same as on the ability to preserve application coherence
5 http://drools.jboss.org/drools-guvnor.html
SBBRENG is closer to ODM with some big differences: domain
model is not Object Oriented and input/output documents are
simple shared folders for storing interchanging files</p>
      <p>External
Systems</p>
      <p>Input
Document</p>
      <sec id="sec-5-1">
        <title>Output</title>
        <p>Document
Rules
Engine
Business User</p>
      </sec>
    </sec>
    <sec id="sec-6">
      <title>3. THE SPREADSHEET-LIKE SIDE OF</title>
    </sec>
    <sec id="sec-7">
      <title>SBBRENG</title>
    </sec>
    <sec id="sec-8">
      <title>3.1 The ApplyRules operation</title>
      <p>A WorkSheet -WS- is a set of files and columns such as each
column has a unique name and each cell stores an immutable
value (current implementation does not yet force this
immutability). A SBBRENG Process is a specific sequence of
steps that modifies a WorkSheet. There is an operation
ApplyRules (•) for implementing SBBRENG Processes,
following statements of Business Rules. A Business Rule is -in
the context of SBBRENG- a directive detailing how to calculate
the numeric values used to run the business.</p>
      <p>We represent a SBBRENG Process using the formula</p>
      <p>BRk • WSp =&gt; (WSkp, OFp)</p>
      <sec id="sec-8-1">
        <title>Where:</title>
        <p>• is the ApplyRules operation
BRk is a subset of the Business Rules comprising the</p>
        <p>Application
WSp is a current WorkSheet that is part of the</p>
        <p>Application
WSkp is a new WorkSheet that will be part of the</p>
        <p>Application
OFp is an Output File that consists of a subset of</p>
        <p>WSkp
Operation • adds new columns at the right of WSp. Business
Rules define how to calculate the immutable values of the new
cells. New columns can reference any column located at its left
(Figure 2).
.</p>
        <p>processing
secuence
AA BB CC DD EE FF GG HH II JJ
a1 b1 c1 d1 e1 f1
a2 b2 c2 d2 e2 f2
a3 b3 c3 d3 e3 f3
g1
g2
g3
can use any value from</p>
        <p>columns AA to GG</p>
      </sec>
    </sec>
    <sec id="sec-9">
      <title>3.2 The Assemble operation</title>
      <p>An Input File becomes a WS when it contains all the information
referenced by one or more Business Rules. When Business Rule
references are contained in several Input Files, it is necessary to
build a WorkSheet by assembling several Input Files. We use the
Assemble operation (+) for this purpose, as shown in the
following formula.</p>
      <p>IFi (p) + IFk (q) =&gt; WSa
Where p is a column of IFi and q is a column of IFk, and they
provide a mechanism for matching rows of the Input Files.
Operation + produces a WorkSheet out of all the columns of both
Input Files. The WorkSheet contains all the IFi (p) rows and for
each of them, only one matching IFk (q) row. The matching logic
is the same of an Excel Table Lookup operation, in which p is a
column in the data and q represents the first column of the table.
The + operation is associative but not commutative.</p>
      <p>The + operation can also be applied to a WorkSheet. In such
cases we have a precedence of Processes. Figure 3 shows an
example in which BR1• WSa precedes BR2 • WSb.
There are situations where it is necessary to assemble the same file
more than one time, using different column keys. In such a case
SBBRENG adds a prefix to column names to avoid collisions. In
the following example, IFk is applied twice:</p>
      <p>( IFi (p) + IFk (q)) (r) +IFk (s) =&gt; WSb</p>
    </sec>
    <sec id="sec-10">
      <title>4. NON COMPATIBLE SPREADSHEET</title>
    </sec>
    <sec id="sec-11">
      <title>FUNTIONALITY</title>
      <p>The most important difference with Spreadsheets is spreadsheet
interactivity, because SBBRENG follows a batch processing
model. Other examples of incompatible features are Table
Lookup, Dynamic Tables, external links, totals and other
columns or rows of the Matrix. Each box has a label that makes
apparent its associated condition.</p>
      <p>New Products</p>
      <p>Old Products
Spot Recurrent Premiun Recurrent Premiun</p>
      <p>Clients Clients Clients Clients Clients</p>
      <p>Salesmen type A
Salesmen North Region
type B</p>
      <p>South Region
Salesmen</p>
      <p>Type C</p>
      <p>North Region
Central Region
South Region
5%
4%
3%
5%
4%
3%
6%
5%
4%
6%
5%
4%
7%
0%
0%
7%
6%
0%
8%
0%
0%
8%
6%
0%
aggregated values in the same column as the original data,
macros, different formulas in the same column, and the
programming language.</p>
    </sec>
    <sec id="sec-12">
      <title>5. SOME ADITIONAL FEATURES OF</title>
    </sec>
    <sec id="sec-13">
      <title>SBBRENG</title>
    </sec>
    <sec id="sec-14">
      <title>5.1 Referential Transparency</title>
      <p>A SBBRENG application offers “referential transparency”, which
is the base for providing reproducible results. In order to achieve
that goal, it is necessary to replace links to external sources (other
spreadsheets, Databases, etc.) by static Input Files containing the
external linked information.</p>
    </sec>
    <sec id="sec-15">
      <title>5.2 Separation of Data and Parameters</title>
      <p>In the context of SBBRENG, Parameters are a special type of
data: input files are produced by other systems, but parameters are
maintained by users. Parameters represent a high level system
abstraction, which is required to adapt the system behavior. Data
is stored in Files and WorkSheets, and Parameters are stored in a
special repository. SBBRENG’s IDE provides the means for
Parameter editing.</p>
    </sec>
    <sec id="sec-16">
      <title>5.3 Iteration over Data</title>
      <p>The calculus performed on each column follows a cycle. Rows are
filtered by conditions and grouped by some column values. The
logic applied to the cells belonging to a group, is repeated for
each group until reaching the last. Some SBBRENG core
functions offer aggregated operations over groups, e.g. count,
sum, average, max.</p>
    </sec>
    <sec id="sec-17">
      <title>5.4 Domain Model</title>
      <sec id="sec-17-1">
        <title>5.4.1 Introduction</title>
        <p>Five objects support Domain modeling: Matrix, Classifier, List,
Rules and Files. Files are input/output files. Rules are pieces of
code that have some specific properties (i.e. name, filter, sequence
and granularity). The three remaining objects are the most
important, because they store in their structure the values of the
Parameters of the application. This allows a direct user interaction
with the Domain Model representation, when adjusting
Parameters values.</p>
        <p>
          Parameters directly represent elements of the ubiquitous language
[
          <xref ref-type="bibr" rid="ref5">5</xref>
          ] Those elements appear in several real life working documents:
memos, agreements, contracts, regulations, etc. The shape of the
Parameters as used in SBBRENG mimics its representation in
documents. Therefore, business users understand them without
requiring further explanations.
        </p>
        <p>As needed, some Parameters may have embedded logic that is
executed every time they are used in a Rule.</p>
      </sec>
      <sec id="sec-17-2">
        <title>5.4.2 Matrixes</title>
        <p>Matrixes are bi-dimensional arrays of values and conditions that
return a value (or several values) based on the evaluation of its
embedded logic.</p>
        <p>Matrixes have two headings, X and Y. Each heading represents a
tree of conditions: sibling nodes make an OR and parent-child
nodes make an AND. It is very easy to see the tree as a set of
adjacent boxes with the outermost boxes of the headings matching
B
c
7%
6%
5%
7%
5%
5%</p>
      </sec>
      <sec id="sec-17-3">
        <title>5.4.3 Classifiers</title>
        <p>Classifiers are Boolean expressions whose value is automatically
set based exclusively on the input data and remain immutable
until the input data change. They represent business concepts,
mostly corresponding to nouns in the ubiquitous language.
Regardless of how many relationships input fields have in the
system they comes from, Classifiers implements only those
conditions required by our application. Classifiers are used by
Matrixes to build its embedded logic.</p>
        <p>Classifiers create a conceptual layer for mapping a SBBRENG
application Domain with the Domain of systems where the input
data were generated. Classifiers are used by Matrixes to build its
embedded logic. Classifiers increase program readability and
improve our ability to adapt to changes in the Input Files.</p>
      </sec>
      <sec id="sec-17-4">
        <title>5.4.4 List and Constants</title>
        <p>A List is a Dictionary where a value associated to an entry can be
simple or complex. Constants are Lists that use a special syntax.</p>
      </sec>
    </sec>
    <sec id="sec-18">
      <title>5.5 Programming Language</title>
      <p>We use JavaScript to replace spreadsheets’ functions. To improve
productivity, we developed a library of "core functions"
frequently used in our Domain of applications. It is easy to add
new core functions.</p>
      <p>
        We also provide a graphic block language, similar to MIT's
Scratch [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] and others [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. Blocks automatically generate the
equivalent JavaScript instructions. Blocks are very well suited to
SBBRENG because each Rule is made of a few instructions.
Blocks were initially implemented for the Assemble operation,
and we have plans to extend it to the Rules.
      </p>
    </sec>
    <sec id="sec-19">
      <title>5.6 Auditing</title>
      <p>A Run is a complete execution of a SBBRENG Application. Each
Run is stored as a backup document containing all inputs, outputs,
parameters and logic utilized. SBBRENG automatically assigns a
unique ID to each Run. Later, a Run can be opened as read-only
for revision, but it cannot be modified. It is possible to reprocess
a backup document, generating a new backup document with a
different ID.</p>
      <p>
        Additionally, there is a log of the changes made to the parameters,
the input files and the logic, indicating old and new values, the
user involved and date/time of all changes.
5.7 IDE
There is a special IDE -Integrated Development Environment- to
support all tasks: application development, documentation,
design, testing, etc. It also has functions for running applications,
for reviewing previous Runs and for downloading results.
The IDE offers two views: a conventional nested folders type and
an advanced mental map type [
        <xref ref-type="bibr" rid="ref8 ref9">8, 9</xref>
        ]. The latter is the base for
some advanced visualization options that ease the understanding
of an Application (pending development).
      </p>
    </sec>
    <sec id="sec-20">
      <title>5.8 Documentation</title>
      <p>Documentation is a part of a broader content we call problem
representation. It includes parameters, code, blocks, ad-hoc
descriptions, etc. Additional to the content, there are tools for
filtering information, displaying information, and displaying
information relationships. Some of this functionality is currently
in use; some is pending development. Because documentation is
supported by the IDE, it is always available on line when working
with the application.</p>
    </sec>
    <sec id="sec-21">
      <title>6. SOFTWARE STRUCTURE</title>
      <p>On the Server side, there is a Web application than runs on IIS
using .NET and SQL Server.</p>
      <p>On the Client side, there is the IDE running in any modern
browser.</p>
    </sec>
    <sec id="sec-22">
      <title>7. RESULTS</title>
      <p>Security and auditability of the applications were improved in
relationship to spreadsheets, as a result of some new specific
functionality (see Subsections 5.1, 5.2 and 5.6).</p>
      <p>Documentation was improved when compared to conventional
solutions, because of the integration of different types of
information into one common repository (see Subsections 5.7,
5.8) and the availability of new capabilities based on the use of a
Mental Map.</p>
      <p>The use of the Domain Model (see Subsection 5.4) enhanced
productivity of development and maintenance, because less code
is required to implement the same business logic compared to
solutions using spreadsheet (See Sub Subsection 5.4.2)
Performance is good. We were expecting 10 min per 2.000
transactions and 4 hrs per 3.000.000 transactions, but real
numbers were 4 min and 1 hr 45min, respectively. We were using
a conventional entry level server.</p>
    </sec>
    <sec id="sec-23">
      <title>8. KEY LESSONS LEARNED FROM</title>
    </sec>
    <sec id="sec-24">
      <title>WORKING WITH SBBRENG</title>
      <p>Looking at one of the components of the productivity equation,
we think we successfully tried some new ideas, like a new
approach for representing the Business Rules Domain, a method
for avoiding complex nested conditions, an IDE based in a Mental
Map, a graphic replacement for the programming language of
spreadsheets, some mechanisms to improve security and
auditability, etc.</p>
      <p>
        But looking at the other component -the process of getting and
agreeing to specifications for building the application- we think it
is necessary to achieve important improvements. The ubiquitous
language requires more elaboration6. The cognitive process that
ends with a working application can probably take advantage of
the impressive new findings in neuroscience. Focus, resources,
new instruments and new methodologies are moving the limits.
“Constant development of more sensitive and accurate
neuroimaging and data analysis methods creates new research
possibilities” [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ].
      </p>
    </sec>
    <sec id="sec-25">
      <title>9. FUTURE DEVELOPMENTS</title>
      <p>We are interested in two areas for future development. The first is
improving automatic analysis capabilities used during the testing
phase, and the other is improving visualization capabilities for
mental maps in the IDE.
6 it has been apparent that some additional concepts are necessary</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <surname>Dunne</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          <year>2010</year>
          .
          <article-title>MarketScope for Sales Incentive Compensation Management Software</article-title>
          .
          <source>Gartner MarketScope Series (March</source>
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <surname>Bosh</surname>
          </string-name>
          <year>2010</year>
          .
          <article-title>The Past, Present, and Future of Business Rules</article-title>
          .
          <source>Bosch Software Innovations GmbH. (March</source>
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <surname>Craggs</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          <year>2012</year>
          .
          <article-title>Competitive Review of Operational Decision Management</article-title>
          , Lustratus Research (
          <year>October 2012</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <surname>IBM</surname>
          </string-name>
          <year>2012</year>
          .
          <article-title>Why IBM Operational Decision Management? Software</article-title>
          . Thought Leadership White Paper (
          <year>June 2012</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <surname>Evans</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          <year>2003</year>
          .
          <article-title>Domain-Driven Design</article-title>
          . Addison Wesley; E (
          <year>August 2003</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <surname>Resnick</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Maloney</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Monroy-Hernández</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rusk</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Eastmond</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Brennan</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Millner</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rosenbaum</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Silver</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Silverman</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          and
          <string-name>
            <surname>Kafai</surname>
            <given-names>Y.</given-names>
          </string-name>
          <string-name>
            <surname>Scratch</surname>
          </string-name>
          <article-title>: Programming for all</article-title>
          .
          <source>Communications of the ACM (November</source>
          <year>2009</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <surname>Hosick</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          <year>2014</year>
          .
          <article-title>Visual Programming Languages - Snapshots</article-title>
          . (
          <year>February 2014</year>
          ) http://blog.interfacevision.com/design/design
          <article-title>-visualprogarmming-languages-snapshots/</article-title>
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <surname>Eppler</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          <year>2006</year>
          .
          <article-title>A comparison between concept maps, mindmaps, conceptual diagrams, and visual metaphors as complementary tools for knowledge construction and sharing</article-title>
          .
          <source>Faculty of Communication Sciences</source>
          , University of Lugano
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <surname>Novak</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          , and
          <string-name>
            <surname>Cañas</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          <year>2008</year>
          .
          <article-title>The Theory Underlying Concept Maps and How to Construct and Use Them. Florida Institute for Human and Machine Cognition (IHMC)</article-title>
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <surname>Jääskeläinen</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          <year>20012</year>
          .
          <string-name>
            <surname>Cognitive</surname>
          </string-name>
          <article-title>Neuroscience: Understanding the neural basis of the human mind</article-title>
          .
          <source>Jääskeläinen &amp; Ventus Publishing ApS (November</source>
          <year>2012</year>
          )| http://bookboon.com/
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>