<!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>A Model-Driven Method for automatic generation of Rule-based Web Applications</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Joaqu n Can~adas</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Jose Palma</string-name>
          <email>jtpalma@um.es</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Samuel Tunez</string-name>
          <email>stunez@ual.es</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Dept. of Information and Communication Engineering. University of Murcia.</institution>
          <country country="ES">Spain</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Dept. of Languages and Computation. University of Almeria.</institution>
          <country country="ES">Spain</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Rule languages and inference engines incorporate reasoning capabilities in Web information systems. In this paper, a Model-Driven Development (MDD) approach for automatic code generation of rulebased Web applications is proposed. A rule-based model specifying domain expert knowledge and business logic through production rules (ifcondition-then-action) becomes the source model for the development approach. Demonstrating our proposal, a tool supports the creation of rule models and the automatic execution of model-to-model and modelto-code transformations. As a result, a rich, functional, rule-based Web architecture is generated, based on the Model-View-Controller architectural pattern and the JavaServer Faces technology, and integrating a Jess rule engine to perform inference tasks.</p>
      </abstract>
      <kwd-group>
        <kwd>Model-Driven Development</kwd>
        <kwd>Web Applications</kwd>
        <kwd>Rule-based systems</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        The design of rule languages and inference engines to provide Web information
systems with reasoning capabilities is an important Semantic Web research topic
[
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] in which production rules (if-condition-then-action) play a leading role, since
they enable a declarative representation of domain expert knowledge and
business logic. Rule engines deal with rule bases and execute inference methods for
ring the right rules in order to deduce information and conclude new results
[
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].
      </p>
      <p>This paper addresses the development of rule-based systems embedded in
Web applications to provide Web systems with inference capabilities, applying a
model-driven approach to automate the development process of rule-based Web
applications.</p>
      <p>
        The terms Model-Driven Architecture (MDA) [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] and Model-Driven
Development (MDD) [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] refer an approach of software development that uses models
as rst class entities, enabling the de nition and automatic execution of
transformations between models and from models to code. The creation of
metamodels for specifying modeling languages is a basic task in MDA/MDD. Also the
speci cation of transformations between models, called model-to-model (M2M)
transformations, and from model to code, called model-to-text (M2T)
transformations. The main advantage of this approach of software development is that
MDD tools enable these transformations to be speci ed and executed
automatically, using supporting languages and tools for MDA/MDD. This development
approach is currently being applied to many domains in software development,
such as embedded systems, Web engineering, Ontology Engineering, and more.
However it has some limitations because it is relatively new, supporting tools
for MDD are not mature enough, and it introduces some rigidity since writing
models is not as exible and expressive as writing source code.
      </p>
      <p>
        In this work Conceptual Modeling Language (CML) [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] is used as rule
modeling formalism, a language for knowledge representation de ned by the
CommonKADS methodology [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. It enables the speci cation of the domain ontology
and a set of production rules which are bound to ontology concepts. Models
written in this formalism are independent of any implementation technology,
and therefore, can be used as the source model in a model-driven approach.
      </p>
      <p>
        To put our proposal into practice, a supporting tool developed using several
tools provided by the Eclipse Modeling Project3 applies a model-driven approach
to rule models and automatically generates the implementation of a functional
rule-based Web application. The resulting Web architecture is based on the
Model-View-Controller (MVC) architectural pattern and the JavaServer Faces
(JSF) framework [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ], and incorporates rich JBoss Richfaces components [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] to
enhance the user interface with AJAX (Asynchronous JavaScript And XML)
capabilities. The Jess rule engine [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] is embedded in the Web architecture to
provide inference features. The functionality of the rule-based Web application
is prede ned to create, read, update and delete instances (CRUD). In contrast
to current tools for automatic generation of CRUD systems that perform those
functions on relational databases, the contribution of our approach is that CRUD
operations are executed on the Jess rule engine working memory, enabling the
inference mechanism to execute a forward-chaining inference mechanism to drive
the reasoning process.
      </p>
      <p>
        The proposed approach materializes InSCo [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ], a methodology which
intertwines knowledge engineering and software engineering approaches in hybrid
intelligent information systems development.
      </p>
      <p>This paper is organized as follows: Section 2 introduces rule-based systems
and rule modeling languages for the Web. Next, the rule-based modeling
approach for specifying the Web applications proposed is described in section 3.
After that, the model-driven method for rule-based Web application
development is detailed in Section 4. The MDD support tool is presented in Section 5.
Section 6 describes related work, and nally main conclusions and future work
are summarized.</p>
    </sec>
    <sec id="sec-2">
      <title>3 http://www.eclipse.org/modeling/</title>
      <sec id="sec-2-1">
        <title>Overview of Rule-based systems and rule modeling</title>
        <p>
          Rule-based systems originated in Arti cial Intelligence, as the kind of expert or
knowledge-based system that use rules as knowledge representation formalism. In
this kind of software system, the human expert's knowledge applied for solving a
complex task such as diagnosis, monitoring, assessment, and so on, is represented
as a set of declarative production rules. Rule engines are able to interpret the
rules, and reason using some inference method to come to a conclusion as the
human expert would do [
          <xref ref-type="bibr" rid="ref11 ref12">11, 12</xref>
          ].
        </p>
        <p>In general, a rule-based system consists of a set of production rules, a
working memory and an inference engine. The rules encode domain knowledge and
business logic as condition-action pairs. The working memory initially represents
the system input, but the actions that occur when rules are red can cause the
state of the working memory to change. The inference engine runs a reasoning
method to re rules, typically forward and backward chaining mechanisms. The
execution of the action part of a rule involves inferring new data.</p>
        <p>
          More recently, the software engineering community has also focused on rules
as a proper formalism for representing business logic in software systems. Today
these two points of view have merged, favoring the widespread adoption of
rulebased systems and business rules in the implementation of complex
decisionmaking processes [
          <xref ref-type="bibr" rid="ref13">13</xref>
          ].
        </p>
        <p>
          Rule formalisms are an active area of research addressing the development
rule languages and inference engines to add reasoning to complex information
systems. The Object Management Group (OMG) proposed the Ontology
Definition MetaModel [
          <xref ref-type="bibr" rid="ref14">14</xref>
          ] and Production Rule Representation [
          <xref ref-type="bibr" rid="ref15">15</xref>
          ] as standard
metamodels for introducing both technologies in the context of MDA/MDD.
Relevant initiatives to standardize and exchange rules are the Rule Markup
Initiative (RuleML) [
          <xref ref-type="bibr" rid="ref16">16</xref>
          ], the Semantic Web Rule Language (SWRL) [
          <xref ref-type="bibr" rid="ref17">17</xref>
          ], the
REWERSE Rule Markup Language (R2ML) [
          <xref ref-type="bibr" rid="ref18">18</xref>
          ], and the Rule Interchange
Format (RIF) [
          <xref ref-type="bibr" rid="ref19">19</xref>
          ].
        </p>
        <p>We use CML as the rule-modeling language because, although it is currently
not one of the most common options for rule modeling, it has several features
desirable for production-rule formalisms. It enables uni ed representation of
ontologies and rules, in which rules and ontology are naturally related. It meets
the requirements of rule representation formalisms, such as modeling rule
antecedent, rule consequent, named rules, and rulesets, binding rules to ontology
concepts, and so on. And nally, it is simpler and easier to use than other
formalisms, although this may mean less expressiveness in certain situations.
3</p>
      </sec>
      <sec id="sec-2-2">
        <title>Modeling Rule-based</title>
      </sec>
      <sec id="sec-2-3">
        <title>Web applications</title>
        <p>The proposed model-driven approach for rule-based Web application
development focuses on introducing rule modeling in the speci cation of Web
applications. However, other modeling concerns related to Web design features must
be also considered, powering the automatic code generation process. The CML
model describing the ontology and rule model is presented at a conceptual level,
whereas interaction and presentation features are speci ed at a Web design level.
3.1</p>
        <sec id="sec-2-3-1">
          <title>Conceptual rule-based modeling</title>
          <p>The CML formalism for knowledge modeling entails the speci cation of
simplied domain ontologies and production rules. A CML (domain knowledge) model
is basically composed of two elements, domain schemas and knowledge bases.
Domain concepts, binary relationships, rule types and value types (enumerated
literals) are Kmnowoleddegeled in a domain schema. A knowledge base is composed of</p>
          <p>Model
instances of concepts, instances of relationships called tuples, and instances of
rules. Figure 1 showsDotmhaien domain knowledge model components.</p>
          <p>Knowledge</p>
          <p>Domain
Schema</p>
          <p>Knowledge</p>
          <p>Base
Concepts</p>
          <p>Rule Types
Binary Relations</p>
          <p>Value Types</p>
          <p>Instances of Concepts</p>
          <p>Instances of Rules</p>
          <p>Tuples</p>
          <p>CML was originally de ned as a textual notation by means of an abstract
grammar described in EBNF (Extended Backus-Naur Form). To use CML in the
context of MDD, we have speci ed a metamodel for CML. The main di erence
between this formalism and other conceptual modeling approaches in software
engineering, such as UML class diagrams, is its ability to model production rules
with rule type and the rule instance constructors. A rule type describes the
structure of a set of rules through the speci cation of the ontology types bound
to the rule antecedent and consequent. Rule types are particularized into rule
instances which represent speci c, logical dependencies between rule antecedent
and consequent concept attributes.
3.2</p>
        </sec>
        <sec id="sec-2-3-2">
          <title>Web design modeling</title>
          <p>CML models are enriched with interaction and presentation characteristics to
specify rule-based Web applications design features.</p>
          <p>Interaction features enable the speci cation of user interactivity through a set
of properties associated to CML constructors. The following properties dealing
with attribute management will illustrate some interaction characteristics:
{ isDerived. This property is set to true when the attribute value is inferred
by the rule engine, so it cannot be edited by the user.
{ noti esTo and isNoti edBy : These properties are used to indicate what
attributes must be refreshed by the re-rendered AJAX facility in a user event,
for example a mouse click or a change in the attribute value.</p>
          <p>Conceptual Model</p>
          <p>Visit
codeVisit : Symbol
month : Month
date : Date
finished : Boolean
Visit_to_PlotOfLand</p>
          <p>visits [*] : Visit
notifiesTo plot : PlotOfLand
possibleStages [*] : PhenologicalStage
phenology : PhenologicalStage
Rule Instance : Phenology-abstraction
visit.month = January
visit_to_plotOfLand.possibleStages = (A,B1,B2)</p>
          <p>M
D
D
C
o
d
e
G
e
n
e
rit
a
o
n</p>
          <p>Web form page</p>
          <p>Visit
Date
Finished
Plot [PlotOfLand]
Phenology
event=”onchanged”</p>
          <p>reRender
PossibleStages</p>
          <p>A - Dormant bud
B1 - Bud swell
B2 - Wooly bud</p>
          <p>Figure 2 shows an example of how the interaction between two attributes
de ned in the conceptual model is speci ed using the isDerived and noti esTo
properties, showing how they a ect Web forms for editing instances. The
example is taken from SAVIA, a decision-support system for pest control in
greenhouse crops and grapes that is being developed by applying rule-based
modeling and the proposed model-driven approach for rule-based Web system
development. The left side of Figure 2 shows a selection of SAVIA conceptual
rule model elements. In particular, a concept called Visit, a relationship called
Visit to PlotOfLand, and an example of rule instance belonging to the group
of rules that specify the possible phenological stages of the crop depending on
the date of the visit. The concrete rule instance is: "if the month of the Visit
is January then the possibleStages are (A, B1, B2)". Focusing on interaction
speci cation, the possibleStages attribute is derived since it is inferred by the
rule engine when it res rules such as the one above. And the attribute date of
visit noti es possibleStages, making that when the event onChange happens in
the Web form date eld, then an action makes the rule engine run and the list of
possibleStages is re-rendered, updating the list with the new values determined
by the rule engine.</p>
          <p>Presentation features specify the conceptual model element's visibility
properties, enabling user interface customization. For example, this makes it possible
to select what concepts will appear in the application menu, and what attributes
are included as columns of tables showing all instances of a concept type.</p>
        </sec>
      </sec>
      <sec id="sec-2-4">
        <title>MDD for Rule-based Web applications</title>
        <sec id="sec-2-4-1">
          <title>General perspective</title>
          <p>Although the two MDD processes are executed independently of each other,
the nal result must integrate the rule base into the Web application. This is
done by the appropriate method calls to the Jess API (Application Programming
Interface) in the Java code generated, entailing integration of the rule engine into
the Web application.</p>
          <p>
            The rule-based Web application generated bene ts of having the decision
logic externalized from core application code, since uncoupling the rules from the
source code increases scalability and maintainability of rule-based applications
[
            <xref ref-type="bibr" rid="ref20">20</xref>
            ]. Our approach makes it possible for the two MDD processes to be executed
separately, and therefore, any change in the rule model a ecting only to rule logic
(rule instances) but without a ecting to the structure of information (concepts,
relationships, and so on) can be translated to a new rule base without having
to modify or regenerate anything else in the Web architecture. This approach
makes Web applications easier to maintain and evolve.
The rst transformation of Jess rules in MDD involves the CML source model
being translated into a platform-speci c model based on a Jess rules metamodel,
using an M2M transformation. The metamodel proposed for Jess rules (Figure
4) is an extended version of a simple rule metamodel for rule-based systems
described in [
            <xref ref-type="bibr" rid="ref21">21</xref>
            ].
          </p>
          <p>+inModule</p>
          <p>RModule
- moduleName : String
- rulemetamodel : String
- outputFilePath : String
1
+funInModule1 1
+extends
0..1
+owner
+factTemplates
0..*
RFactTemplate
- factName : String
1</p>
          <p>+rules 0..*</p>
          <p>RRule
- ruleName : String
- ruleType : RRuleType
+factTem0p.l.a+*tfeactTe0m..*plate -- dSeaslicernipcteio:nIn1:tSetgreinrg 1
0..*
+functions
{ordered}
0..* RFunction</p>
          <p>- functionName : String
+actions - parameters [0..] : String</p>
          <p>0..* -- fruentucrtnioVnaTluyepe: S:RtriFnugnctionType
{ordered}
0..*
+Slot
{ordered}</p>
          <p>RFactSlot
- slotName : String
- slotValueRange : String
- slotCardinality : RSlotCardinality
- slotType : String
&lt;&lt;enumeration&gt;&gt;
RSlotCardinality
- slot
- multislot
+condition
0..1RCondElem
- ceName : RCondElemEnum
+ceMatchPattern1 0.*.* +childCE 1</p>
          <p>RPa0t.t.e*rn 0..* +c+ecMeMatacthcPhPatatettrenrn
1 0..* {ordered}
0..* +slotMatchExp
RSlotMatchExp
- slotName : String
- matchExp : String
&lt;&lt;enumeration&gt;&gt;
RFunctionType
- system
- userdefined
&lt;&lt;enumeration&gt;&gt;</p>
          <p>RRuleType
- constraint
- initialization
+defFacts 0..*</p>
          <p>RDefFacts
- defName : String
- documentation : String
+facts 0..*</p>
          <p>RDefFact
- factName : String
0..* +queries</p>
          <p>RQuery
- queryName : String
- documentation : String
- quetyType : RQueryType
+variables
{ordered} 0..*</p>
          <p>RVariable
- varName : String
+slots 0..* +slotValue</p>
          <p>RDefSlot RDefSlotValue
- slotcardinality : RSlotCardinality 1..* - value : String
- slotName : String
&lt;&lt;enumeration&gt;&gt;</p>
          <p>RQueryType
-- aalFFaacctBtsyKey</p>
          <p>In the Jess rules metamodel, a metaclass is de ned for each Jess language
element. The root element of a Jess rule model is RModule. A module contains
fact templates, rules, functions, facts and queries. The RFactTemplate metaclass
models fact templates, the Jess constructor for storing information.</p>
          <p>RRule enables the representation of rules. A rule has a ruleName, a property
called salience that determines the order in which applicable rules are red by
the rule engine, a containment reference condition representing the rule's
condition part (antecedent), and a reference called actions representing the rule's
action part (consequent). RPattern and RSlotMatchExp metaclasses de ne
pattern matching expressions in rule conditions. Actions are function calls that
assert new facts, or retract or modify existing facts.</p>
          <p>Facts are de ned by the RDefFacts metaclass. Facts are acquired from
instances of concepts in the CML source model. Finally, RQuery models queries
to consult the working memory at runtime.</p>
          <p>The mapping from CML rule-based models to Jess rule models is designed
by a M2M transformation which maps each CML metamodel constructor to
one or several Jess Rule metamodel elements. The Jess rule model generated by
the M2M transformation is the source model for a M2T transformation which
automatically generates the Jess rule base source code, producing a Jess le
(.clp) with a code for every element included in the Jess rule model. The M2T
transformation is designed using JET, as described later in this paper.
4.3</p>
        </sec>
        <sec id="sec-2-4-2">
          <title>MDD of JSF Web architecture</title>
          <p>A second MDD process is applied (see Figure 3) to generate a Web architecture
that integrates rules into a Web application. In this process, Jess rules can be
integrated into the Web application, since both the Jess rule base and the Web
architecture are generated from the same CML model.</p>
          <p>Figure 5 shows the proposed target architecture for rule-based Web
applications, based on the MVC architecture pattern, the JSF framework and rich
AJAX JBoss Richfaces components.</p>
          <p>Web Browser</p>
          <p>Apache Tomcat
Application Server</p>
          <p>JavaEE Platform</p>
          <p>JSF
+</p>
          <p>RichFaces
Jess rule engine</p>
          <p>Jess
rule base</p>
          <p>Jess facts</p>
          <p>The integrated rule engine manages the Jess rule base and the text le
containing persistent facts. The Web application enables the user to perform four
basic predetermined functions, create new instances, read the current list of
instances, update and delete instances. That CRUD operations are executed on
the Jess rule engine working memory, enabling the inference mechanism to re
appropriate rules when necessary. The rule engine executes a forward-chaining
inference mechanism to drive the reasoning process, ring the rules with
conditions evaluated as true, and executing their actions to infer new information or
modify existing one.</p>
          <p>A metamodel for the JSF Web architecture was designed. In the M2M and
M2T transformations from a CML model to a JSF model and nally to code,
each concept is mapped to several elements, a JavaBean class, a JSF page for
instance creation and edition, a JSF page for listing all instances of that concept
type, and a managed bean to be included in the con guration le. Interaction
and presentation features are taken into account at this level in model-driven
processes.</p>
          <p>As a result, the use of both rules and AJAX technology improves the
creation and edition of instances in the Web application. Since Web forms are
implemented with AJAX RichFaces components, each single form value can be
validated and submitted individually as it is entered. This facility entails the
rule engine ring suitable rules and inferring new information that drives the
instance creation or edition, for example, updating choice- eld values.
5</p>
        </sec>
      </sec>
      <sec id="sec-2-5">
        <title>Tool Support: InSCo-Gen</title>
        <p>Our rule-based Web application model-driven development approach is
demonstrated by our proof-of-the-concept, the InSCo-Gen tool. InSCo-Gen was
developed using MDD tools provided by the Eclipse Modeling Project. Models
and metamodels were de ned using the Eclipse Modeling Framework (EMF4),
including three metamodels, the CML metamodel for conceptual models, the
Jess Rule metamodel used for representing Jess platform-speci c models, and
the JSF metamodel used by Web-based speci c models.</p>
        <p>
          Conceptual models conforming to the CML metamodel are created using
the built-in re ective EMF editor. In order to improve model speci cation, the
re ective editor is customized using Exeed (EXtended Emf EDitor) [
          <xref ref-type="bibr" rid="ref22">22</xref>
          ], a plugin
which can modify editor default icons and labels, adding Exeed annotations to
the metamodel. A screenshot with a model created with this editor is shown in
Figure 2.
        </p>
        <p>Modeling certain aspects of Web design, such as interaction and presentation,
is implemented in di erent ways. Whereas interaction features are added to
the conceptual CML metamodel through metaclass properties, presentation is
de ned by a set of XML con guration les, which can be edited by the developer
before generating the Web application code.</p>
        <p>Two M2M transformations are designed with Atlas Transformation Language
(ATL5). The rst one maps a CML model to a Jess platform-speci c model. The
second one transforms a CML model into a JSF-speci c model.</p>
        <p>
          The outputs of both ATL transformations are the inputs of two M2T
transformations implemented with Java Emitter Templates (JET6). As a result,
InSCoGen automatically produces the Web application code, on one hand, source text
les with Jess rules and facts, and on the other, the Web application components,
the faces-con g.xml and web.xml con guration les, the Java Beans for model
classes, and a Jess-Engine Bean which uses the Jess Java API (Application
Programming Interface) to integrate the rule engine into the architecture. Moreover,
a set of JSP/JSF web pages are generated for the user interface. These pages are
based on the RichFaces library [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ], an open source framework that adds AJAX
capability to JSF applications.
        </p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>4 http://www.eclipse.org/modeling/emf/ 5 http://www.eclipse.org/m2m/atl/ 6 http://www.eclipse.org/modeling/m2t/?project=jet</title>
      <sec id="sec-3-1">
        <title>Related</title>
      </sec>
      <sec id="sec-3-2">
        <title>Work</title>
        <p>
          Our proposal uses the CML rule and ontology modeling formalism as the MDD
source model. To put CML into the MDD framework, we de ned a metamodel
for CML. The de nition of a UML Pro le for the speci cation of CML knowledge
models is addressed in [
          <xref ref-type="bibr" rid="ref23">23</xref>
          ] where the authors also discusses the possible mapping
of the pro le elements to a Jess platform speci c model.
        </p>
        <p>
          Some previous work has proposed the generation of Jess rules from ontology
and rule models, such as OWL (Ontology Web Language) [
          <xref ref-type="bibr" rid="ref24">24</xref>
          ] and SWRL
(Semantic Web Rule Language) [
          <xref ref-type="bibr" rid="ref25">25</xref>
          ]. These proposals focus on Jess code generation
without applying a genuine MDD/MDA approach. But the most important
difference between the proposal presented in this paper and those publications is
that they do not integrate Jess into a functional Web application, so the Jess
rule base generated must be run in a development tool using a shell, such as the
Protege JessTab [
          <xref ref-type="bibr" rid="ref26">26</xref>
          ].
        </p>
        <p>
          An MDD approach to Web Applications based on MVC and JavaServer
Faces is described in [
          <xref ref-type="bibr" rid="ref27">27</xref>
          ]. Existing Web Engineering methods, such as UWE
[
          <xref ref-type="bibr" rid="ref28">28</xref>
          ], WebML [
          <xref ref-type="bibr" rid="ref29">29</xref>
          ] and WebDSL [
          <xref ref-type="bibr" rid="ref30">30</xref>
          ], approach the design and development of
Web applications addressing such concerns as structure, presentation,
navigation. However, they do not consider rule modeling in Web application
development. Our proposal focus on introducing rule modeling in this context, and we
do not consider other concerns of Web application modeling such as navigation
model, since we simplify the functionality to CRUD operations and, therefore,
types and navigation links are xed and preset.
        </p>
        <p>
          Regarding MDD of Web applications integrating rules, [
          <xref ref-type="bibr" rid="ref31">31</xref>
          ] describes MDD
principles for rule-based Web services modeling using R2ML, and proposes an
MDD approach for generating Web services from rule models. Whereas this
proposal focuses on a Web services architecture, our work is based on a MVC
architecture using the JSF framework.
7
        </p>
      </sec>
      <sec id="sec-3-3">
        <title>Conclusions and future work</title>
        <p>In this paper, rule-based and model-driven techniques are intertwined for the
development of rule-based Web applications. The main contribution of our work
is to enrich the speci cation of Web applications with a rule modeling formalism,
introducing a new concern in Model-Driven Web Engineering. A model-driven
approach for generating Web implementation enhanced with inference features
is described and demonstrated by an MDD tool.</p>
        <p>The resulting rule-based Web architecture implements the MVC architectural
pattern using the JavaServer Faces framework, and incorporates rich JBoss
Richfaces components to enhance the user interface with AJAX capabilities. The Jess
rule engine is embedded in the Web application to provide inference capabilities.
Our proposal does not include a navigation model, since application functionality
is predetermined by CRUD functions.</p>
        <p>Due to the declarative nature of rules, the decision logic is externalized from
core application code producing Web applications easier to maintain and evolve.</p>
        <p>The approach is being evaluated through its use in the development of a Web
decision-support system for pest control in agriculture, which makes
recommendations to growers and technicians about the necessity of treating a speci c pest
or disease in grapes.</p>
        <p>
          As future work, it is planned to use other ontology and rule modeling
languages such as OWL and SWRL as source models for the model-driven
approach, and de ne interoperability modules with other rule formalisms. Di
erent rule platforms, such as JBoss Rules [
          <xref ref-type="bibr" rid="ref32">32</xref>
          ], will be also considered as a target
rule technology. The Web application generated, which is aimed at enriching
the architecture with database facilities, will be improved to provide a complete
persistence layer.
        </p>
        <p>Acknowledgments. This work was supported by the Spanish Ministry of
Education and Science under the project TIN2004-05694, and by the Junta de
Andalucia (Andalusian Regional Govt.) project P06-TIC-02411.</p>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Eiter</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ianni</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Krennwallner</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Polleres</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Rules and ontologies for the semantic web</article-title>
          . In Baroglio,
          <string-name>
            <given-names>C.</given-names>
            ,
            <surname>Bonatti</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.A.</given-names>
            ,
            <surname>Maluszynski</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            ,
            <surname>Marchiori</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Polleres</surname>
          </string-name>
          ,
          <string-name>
            <surname>A.</surname>
          </string-name>
          , Scha ert, S., eds.
          <source>: Reasoning Web</source>
          . Volume
          <volume>5224</volume>
          of Lecture Notes in Computer Science., Springer (
          <year>2008</year>
          )
          <volume>1</volume>
          {
          <fpage>53</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Brachman</surname>
            ,
            <given-names>R.J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Levesque</surname>
            ,
            <given-names>H.J.</given-names>
          </string-name>
          :
          <article-title>Knowledge representation and reasoning</article-title>
          . Morgan Kaufmann, San Francisco (
          <year>2004</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3. Object Management Group:
          <source>MDA Guide Version 1.0</source>
          .1. OMG document: omg/2003-06-
          <fpage>01</fpage>
          (
          <year>2003</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Mellor</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Clark</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Futagami</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          :
          <string-name>
            <surname>Model-Driven</surname>
          </string-name>
          Development - Guest editors introduction.
          <source>IEEE Software</source>
          <volume>20</volume>
          (
          <article-title>5) (Sep-Oct</article-title>
          <year>2003</year>
          )
          <volume>14</volume>
          {
          <fpage>18</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Anjewierden</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <source>CML2</source>
          .
          <source>Technical Report 11</source>
          , University of Amsterdam (
          <year>1997</year>
          ) URL: http://www.swi.psy.uva.nl/projects/kads22/#cml2.
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Schreiber</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Akkermans</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Anjewierden</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>de</surname>
            <given-names>Hoog</given-names>
          </string-name>
          , R.,
          <string-name>
            <surname>Shadbolt</surname>
          </string-name>
          , N.,
          <string-name>
            <surname>de Velde</surname>
            ,
            <given-names>W.V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wielinga</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          :
          <article-title>Knowledge Engineering and Management: The CommonKADS Methodology</article-title>
          . The MIT Press, Cambridge (
          <year>2000</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>7. Sun Microsystems: JavaServer Faces http://java.sun.com/javaee/javaserverfaces/.</mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8. JBoss: RichFaces (
          <year>2007</year>
          ) http://www.jboss.org/jbossrichfaces/.
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Friedman-Hill</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          : Jess in Action:
          <source>Java Rule-Based Systems. Manning Publications</source>
          (
          <year>2003</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>del Aguila</surname>
            ,
            <given-names>I.M.</given-names>
          </string-name>
          , Can~adas, J.,
          <string-name>
            <surname>Palma</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tunez</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          :
          <article-title>Towards a methodology for hybrid systems software development</article-title>
          .
          <source>In: Proceedings of the Int. Conference on Software Engineering and Knowledge Engineering (SEKE)</source>
          .
          <article-title>(</article-title>
          <year>2006</year>
          )
          <volume>188</volume>
          {
          <fpage>193</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Durkin</surname>
          </string-name>
          , J.:
          <source>Expert Systems: Catalog of Applications</source>
          . Akron (Ohio),
          <source>Intelligent Computer Systems Inc</source>
          . (
          <year>1993</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Russell</surname>
            ,
            <given-names>S.J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Norvig</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          :
          <article-title>Arti cial intelligence: a modern approach</article-title>
          . Prentice-Hall, Inc., Upper Saddle River, NJ, USA (
          <year>1995</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13. Object Management Group:
          <article-title>Semantics of Business Vocabulary and Business Rules (SBVR)</article-title>
          . http://www.omg.org/spec/SBVR/1.0 (
          <year>2008</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <surname>Object Management Group: Ontology De nition Metamodel</surname>
            <given-names>RFP</given-names>
          </string-name>
          (
          <year>2003</year>
          ) Available: http://www.omg.org/cgi-bin/doc?ad/2003-03-40.
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15. Object Management Group:
          <article-title>Production Rule Representation RFP (</article-title>
          <year>2003</year>
          ) Available: http://www.omg.org/cgi-bin/doc?br/2003-09-03.
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16.
          <string-name>
            <surname>RuleML: The Rule Markup Initiative</surname>
          </string-name>
          (
          <year>2001</year>
          ) URL: http://www.ruleml.org.
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          17.
          <string-name>
            <surname>Horrocks</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Patel-Schneider</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Boley</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tabet</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Grosof</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dean</surname>
            ,
            <given-names>M.:</given-names>
          </string-name>
          <article-title>SWRL: A Semantic Web Rule Language combining OWL and RuleML</article-title>
          . W3C. Available at www.w3.org/Submission/2004/SUBM-SWRL-
          <volume>20040521</volume>
          (
          <year>2004</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          18. REWERSE Working Group I1:
          <fpage>R2ML</fpage>
          -
          <string-name>
            <surname>The REWERSE I1 Rule Markup Language</surname>
          </string-name>
          (
          <year>2006</year>
          ) URL: http://oxygen.informatik.tu-cottbus.de/rewerse-i1/?q=
          <fpage>R2ML</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          19. Rule Interchange Format Working Group:
          <article-title>RIF Use Cases and Requirements</article-title>
          . W3C Working Draft (
          <year>2006</year>
          ) URL: http://www.w3.org/TR/rif-ucr/.
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          20.
          <string-name>
            <surname>Frankel</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hayes</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kendall</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>McGuinness</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          :
          <article-title>The Model Driven Semantic Web</article-title>
          .
          <source>In: 1st International Workshop on the Model-Driven Semantic Web (MDSW2004)</source>
          , Monterey, California, USA. (
          <year>2004</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          21.
          <string-name>
            <surname>Chaur G. Wu</surname>
          </string-name>
          <article-title>: Modeling Rule-Based Systems with EMF</article-title>
          . Eclipse Corner Articles http://www.eclipse.org/articles/ (
          <year>2004</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref22">
        <mixed-citation>
          22.
          <string-name>
            <surname>Kolovos</surname>
            ,
            <given-names>D.S.</given-names>
          </string-name>
          :
          <string-name>
            <surname>Exeed: EXtended Emf EDitor - User Manual</surname>
          </string-name>
          . http://www.eclipse.org/gmt/epsilon/doc/Exeed.pdf (
          <year>2007</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref23">
        <mixed-citation>
          23.
          <string-name>
            <surname>Abdullah</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Benest</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Paige</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kimble</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          :
          <article-title>Using uni ed modeling language for conceptual modelling of Knowledge-Based systems</article-title>
          . In: Conceptual Modeling - ER
          <year>2007</year>
          .
          <article-title>(</article-title>
          <year>2007</year>
          )
          <volume>438</volume>
          {
          <fpage>453</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref24">
        <mixed-citation>
          24.
          <string-name>
            <surname>Mei</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bontas</surname>
            ,
            <given-names>E.P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lin</surname>
            ,
            <given-names>Z.</given-names>
          </string-name>
          :
          <article-title>OWL2Jess: A Transformational Implementation of the OWL Semantics</article-title>
          .
          <source>Lecture Notes in Computer Science</source>
          <volume>3759</volume>
          (
          <year>2005</year>
          )
          <volume>599</volume>
          {
          <fpage>608</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref25">
        <mixed-citation>
          25.
          <string-name>
            <surname>OConnor</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Knublauch</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tu</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Grosof</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dean</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Grosso</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Musen</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Supporting Rule System Interoperability on the Semantic Web with SWRL</article-title>
          .
          <source>Lecture Notes in Computer Science</source>
          <volume>3759</volume>
          (
          <year>2005</year>
          )
          <volume>974</volume>
          {
          <fpage>986</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref26">
        <mixed-citation>
          26.
          <string-name>
            <surname>Eriksson</surname>
          </string-name>
          , H.:
          <article-title>Using JessTab to integrate Protege and Jess</article-title>
          .
          <source>Intelligent Systems, IEEE</source>
          <volume>18</volume>
          (
          <issue>2</issue>
          ) (
          <year>2003</year>
          )
          <volume>43</volume>
          {
          <fpage>50</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref27">
        <mixed-citation>
          27.
          <string-name>
            <surname>Distante</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pedone</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rossi</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Canfora</surname>
          </string-name>
          , G.:
          <article-title>Model-Driven development of web applications with UWA, MVC and JavaServer faces</article-title>
          . In: L.
          <string-name>
            <surname>Baresi</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          <string-name>
            <surname>Fraternali</surname>
          </string-name>
          , and G.
          <string-name>
            <surname>-J. Houben</surname>
          </string-name>
          (Eds.):
          <source>ICWE</source>
          <year>2007</year>
          ,
          <article-title>LNCS</article-title>
          . Volume
          <volume>4607</volume>
          ., Springer, Heidelberg (
          <year>2007</year>
          )
          <volume>457</volume>
          {
          <fpage>472</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref28">
        <mixed-citation>
          28.
          <string-name>
            <surname>Koch</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Knapp</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          , Zhang, G.,
          <string-name>
            <surname>Baumeister</surname>
          </string-name>
          , H.:
          <article-title>Uml based web engineering: An approach based on standards</article-title>
          . In: Web Engineering:
          <article-title>Modelling and Implementing Web applications</article-title>
          . Human-Computer Interaction Series. Springer, Berlin (dec
          <year>2007</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref29">
        <mixed-citation>
          29.
          <string-name>
            <surname>Fraternali</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bongio</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Brambilla</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Comai</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Matera</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <string-name>
            <surname>Designing DataIntensive Web Applications</surname>
          </string-name>
          .
          <volume>1</volume>
          <fpage>edn</fpage>
          . Morgan Kaufmann (
          <year>December 2002</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref30">
        <mixed-citation>
          30.
          <string-name>
            <surname>Groenewegen</surname>
            ,
            <given-names>D.M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hemel</surname>
            ,
            <given-names>Z.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kats</surname>
            ,
            <given-names>L.C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Visser</surname>
          </string-name>
          , E.:
          <article-title>WebDSL: a domain-speci c language for dynamic web applications</article-title>
          . In:
          <article-title>Companion to the 23rd ACM SIGPLAN conference on Object-oriented programming systems languages and applications</article-title>
          , Nashville,
          <string-name>
            <surname>TN</surname>
          </string-name>
          , USA, ACM (
          <year>2008</year>
          )
          <volume>779</volume>
          {
          <fpage>780</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref31">
        <mixed-citation>
          31.
          <string-name>
            <surname>Ribaric</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gasevic</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Milanovic</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Giurca</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lukichev</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wagner</surname>
          </string-name>
          , G.:
          <article-title>Model-Driven engineering of rules for web services</article-title>
          .
          <source>In: Generative and Transformational Techniques in Software Engineering II: International Summer School</source>
          ,
          <string-name>
            <surname>GTTSE</surname>
          </string-name>
          <year>2007</year>
          , Braga,
          <source>Portugal, July 2-7</source>
          ,
          <year>2007</year>
          . Revised Papers, Springer-Verlag (
          <year>2008</year>
          )
          <volume>377</volume>
          {
          <fpage>395</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref32">
        <mixed-citation>32. JBoss: Drools documentation http://www.jboss.org/drools/documentation.html.</mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>