[jboss-svn-commits] JBL Code SVN: r23796 - in labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US: Chapter-Rule_Engine and 1 other directory.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Sun Nov 9 17:54:40 EST 2008
Author: ellenzhao
Date: 2008-11-09 17:54:40 -0500 (Sun, 09 Nov 2008)
New Revision: 23796
Modified:
labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Rule_Engine/Section-Rules.xml
labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Rule_Engine/Section-What_is_a_Rule_Engine.xml
labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Rule_Engine/Section-Why_use_a_Rule_Engine.xml
labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/master.xml
Log:
1. added a svg picture. 2. cleaned up some text
Modified: labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Rule_Engine/Section-Rules.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Rule_Engine/Section-Rules.xml 2008-11-09 20:56:26 UTC (rev 23795)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Rule_Engine/Section-Rules.xml 2008-11-09 22:54:40 UTC (rev 23796)
@@ -220,18 +220,18 @@
be a "closed statement". In programming terms this is an expression that
does not reference any variables:</para>
- <para>10 == 2 * 5</para>
+ <programlisting>10 == 2 * 5</programlisting>
<para>Expressions that evaluate against one or more variables, the facts,
are "open statements", in that we cannot determine whether the statement
is true until we have a variable instance to evaluate against:</para>
- <para>Person.sex == "male"</para>
+ <programlisting>Person.sex == "male"</programlisting>
<para>With SQL if we look at the conclusion's action as simply returning
the matched fact to the user:</para>
- <para>select * from People where People.sex == "male"</para>
+ <para>select * from Person where Person.sex == "male"</para>
<para>For any rows, which represent our facts, that are returned we have
inferred that those facts are male people. The following diagram shows how
@@ -243,7 +243,7 @@
<mediaobject>
<imageobject>
- <imagedata align="center" fileref="images/Chapter-Rule_Engine/Male_People.png" format="PNG" />
+ <imagedata align="center" fileref="images/Chapter-Rule_Engine/Male_Person.svg" format="SVG" contentwidth="485px" contentdepth="213px" />
</imageobject>
</mediaobject>
</figure>
@@ -256,30 +256,18 @@
'&&' and '||'. The following shows two open propositional
statements connected together with a single disjunctive connective.</para>
- <programlisting>
-
- person.getEyeColor().equals("blue") || person.getEyeColor().equals("green")
-
- </programlisting>
+ <programlisting role="JAVA">person.getEyeColor().equals("blue") || person.getEyeColor().equals("green")</programlisting>
<para>This can be expressed using a disjunctive Conditional Element
connective - which actually results in the generation of two rules, to
represent the two possible logic outcomes.</para>
- <programlisting>
-
- Person( eyeColour == "blue" ) || Person( eyeColor == "green" )
-
- </programlisting>
+ <programlisting role="JAVA">Person( eyeColour == "blue" ) || Person( eyeColor == "green" )</programlisting>
<para>Disjunctive field constraints connectives could also be used and
would not result in multiple rule generation.</para>
- <programlisting>
-
- Person( eyeColour == "blue"||"green" )
-
- </programlisting>
+ <programlisting role="JAVA">Person( eyeColour == "blue"||"green" )</programlisting>
<para>Propositional Logic is not Turing complete, limiting the problems
you can define, because it cannot express criteria for the structure of
@@ -287,9 +275,9 @@
Logic with two new quantifier concepts to allow expressions defining
structure - specifically universal and existential quantifiers. Universal
quantifiers allow you to check that something is true for everything;
- normally supported by the 'forall' conditional element. Existential
+ normally supported by the <code>forall</code> conditional element. Existential
quantifiers check for the existence of something, in that it occurs at
- least once - this is supported with 'not' and 'exists' conditional
+ least once - this is supported with <code>not</code> and <code>exists</code> conditional
elements.</para>
<para>Imagine we have two classes - Student and Module. Module represents
@@ -300,19 +288,14 @@
40" open proposition to check for the existence of a Module that is true
for the specified criteria.</para>
- <programlisting>
-
- public class Student {
+ <programlisting role="JAVA"><![CDATA[public class Student {
private String name;
private List modules;
...
- }
-
- </programlisting>
+ }]]></programlisting>
- <programlisting>
-
+ <programlisting role="JAVA">
public class Module {
private String name;
private String studentName;
@@ -325,8 +308,7 @@
things, to iterate data structures to check for existence. The following
should return a List of students who have failed the semester.</para>
- <programlisting>
-
+ <programlisting role="JAVA">
List failedStudents = new ArrayList();
for ( Iterator studentIter = students.iterator(); studentIter.hasNext();) {
@@ -338,8 +320,7 @@
break;
}
}
- }
-
+ }
</programlisting>
<para>Early SQL implementations were not Turing complete as they did not
@@ -348,8 +329,7 @@
and 'in'. The following show SQL and a Rule to return a set of Students
who have failed the semester.</para>
- <programlisting>
-
+ <programlisting role="SQL">
select
*
from
@@ -362,20 +342,14 @@
where
m.student_name = s.name and
m.score < 40
-)
+)</programlisting>
- </programlisting>
-
<para></para>
- <programlisting>
-
+ <programlisting role="JAVA">
rule "Failed_Students"
when
exists( $student : Student() && Module( student == $student, score < 40 ) )
-
</programlisting>
-
- <para></para>
</section>
</section>
Modified: labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Rule_Engine/Section-What_is_a_Rule_Engine.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Rule_Engine/Section-What_is_a_Rule_Engine.xml 2008-11-09 20:56:26 UTC (rev 23795)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Rule_Engine/Section-What_is_a_Rule_Engine.xml 2008-11-09 22:54:40 UTC (rev 23796)
@@ -26,18 +26,17 @@
MYCIN medical diagnosis Expert System. Where-as early Expert Systems had
their logic hard coded, "shells" separated the logic from the system,
providing an easy to use environment for user input. Drools is a Rule
- Engine that uses the Rule Based approached to implement an Expert System
+ Engine that uses the Rule Based approach to implement an Expert System
and is more correctly classified as a Production Rule System.</para>
<para>The term "Production Rule" originates from formal grammar - where it
is described as "an abstract structure that describes a formal language
precisely, i.e., a set of rules that mathematically delineates a (usually
infinite) set of finite-length strings over a (usually finite) alphabet"
- (<ulink
- url="http://en.wikipedia.org/wiki/Formal_grammar">wikipedia</ulink>).</para>
+ (<ulink url="http://en.wikipedia.org/wiki/Formal_grammar"><citetitle>wikipedia</citetitle></ulink>).</para>
<para>Business Rule Management Systems build additional value on top of a
- general purpose Rule Engines by providing, business user focused, systems
+ general purpose Rule Engines by providing business user focused systems
for rule creation, management, deployment, collaboration, analysis and end
user tools. Further adding to this value is the fast evolving and popular
methodology "Business Rules Approach", which is a helping to formalize the
@@ -58,22 +57,22 @@
transitions in a Workflow. At each node it evaluates has a rule set that
dictates the transition to undertake - this is also a Rule Engine. While a
Production Rule System is a kind of Rule Engine and also an Expert System,
- the validation and expression evaluation Rule Engines mention previously
+ the validation and expression evaluation Rule Engines mentioned previously
are not Expert Systems.</para>
<para>A Production Rule System is Turing complete with a focus on
knowledge representation to express propositional and first order logic in
- a concise, non ambiguous and declarative manner. The brain of a Production
+ a concise, non-ambiguous and declarative manner. The brain of a Production
Rules System is an Inference Engine that is able to scale to a large
- number of rules and facts. The Inference Engine matches facts and data,
- against Production Rules, also called Productions or just Rules, to infer
+ number of rules and facts. The Inference Engine matches facts and data
+ against Production Rules - also called Productions or just Rules - to infer
conclusions which result in actions. A Production Rule is a two-part
structure using First Order Logic for knowledge representation.</para>
- <programlisting>when
- <conditions>
+ <programlisting role="JAVA"><![CDATA[when
+ <conditions>
then
- <actions></programlisting>
+ <actions>;]]></programlisting>
<para>The process of matching the new or existing facts against Production
Rules is called <indexterm>
@@ -105,7 +104,7 @@
<primary>Rete</primary>
</indexterm> Rete algorithm, <indexterm>
<primary>Leaps</primary>
- </indexterm> Leaps used to be provided but was retired as it became unmaintaned. The Drools <indexterm>
+ </indexterm> Leaps used to be provided but was retired as it became unmaintained. The Drools <indexterm>
<primary>Rete</primary>
</indexterm> Rete implementation is called ReteOO, signifying that
Drools has an enhanced and optimized implementation of the Rete algorithm
@@ -131,11 +130,11 @@
strategy.</para>
<figure>
- <title>A Basic Rete network</title>
+ <title>High-level View of a Rule Engine</title>
<mediaobject>
<imageobject>
- <imagedata align="center" fileref="images/Chapter-Rule_Engine/rule-engine-inkscape.png" format="PNG" />
+ <imagedata align="center" fileref="images/Chapter-Rule_Engine/rule-engine-inkscape.svg" format="SVG" contentwidth="540px" contentdepth="300px" />
</imageobject>
</mediaobject>
</figure>
@@ -148,7 +147,7 @@
Maintenance, which always ensures that hope can only exist for a
democracy while we have honest politicians.</para>
- <programlisting>
+ <programlisting role="JAVA">
when
an honest Politician exists
then
Modified: labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Rule_Engine/Section-Why_use_a_Rule_Engine.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Rule_Engine/Section-Why_use_a_Rule_Engine.xml 2008-11-09 20:56:26 UTC (rev 23795)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-Rule_Engine/Section-Why_use_a_Rule_Engine.xml 2008-11-09 22:54:40 UTC (rev 23796)
@@ -199,14 +199,16 @@
<section>
<title>When not to use a Rule Engine</title>
- <para>To quote a Drools mailing list regular (Dave Hamu): "It seems to me
+ <para>To quote a Drools mailing list regular: <blockquote><attribution>Dave Hamu</attribution>
+<para>It seems to me
that in the excitement of working with rules engines, that people forget
that a rules engine is only one piece of a complex application or
solution. Rules engines are not really intended to handle workflow or
process executions nor are workflow engines or process management tools
designed to do rules. Use the right tool for the job. Sure, a pair of
pliers can be used as a hammering tool in a pinch, but that's not what
- it's designed for."</para>
+ it's designed for.</para>
+</blockquote></para>
<para>As rule engines are dynamic (dynamic in the sense that the rules can
be stored and managed and updated as data), they are often looked at as a
Modified: labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/master.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/master.xml 2008-11-09 20:56:26 UTC (rev 23795)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/master.xml 2008-11-09 22:54:40 UTC (rev 23796)
@@ -1,63 +1,59 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0" encoding="UTF-8"?>
<book version="5.0" xmlns="http://docbook.org/ns/docbook"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:xi="http://www.w3.org/2001/XInclude"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns:m="http://www.w3.org/1998/Math/MathML"
- xmlns:html="http://www.w3.org/1999/xhtml"
- xmlns:db="http://docbook.org/ns/docbook" >
- <info>
- <title>Drools Expert User Guide</title>
+ xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude"
+ xmlns:svg="http://www.w3.org/2000/svg" xmlns:m="http://www.w3.org/1998/Math/MathML"
+ xmlns:html="http://www.w3.org/1999/xhtml" xmlns:db="http://docbook.org/ns/docbook">
+ <info>
+ <title>Drools Expert User Guide</title>
- <releaseinfo>5.0.0.SNAPSHOT</releaseinfo>
+ <releaseinfo>5.0.0.SNAPSHOT</releaseinfo>
- <author>
- <firstname>Mark</firstname>
- <surname>Proctor</surname>
- </author>
+ <author>
+ <personname>
+ <firstname>Mark</firstname>
+ <surname>Proctor</surname>
+ </personname>
+ </author>
- <author>
- <firstname>Michael</firstname>
- <surname>Neale</surname>
- </author>
+ <author>
+ <personname>
+ <firstname>Michael</firstname>
+ <surname>Neale</surname>
+ </personname>
+ </author>
- <author>
- <firstname>Edson</firstname>
- <surname>Tirelli</surname>
- </author>
- </info>
+ <author>
+ <personname>
+ <firstname>Edson</firstname>
+ <surname>Tirelli</surname>
+ </personname>
+ </author>
+ </info>
-<!--
- <preface id="preface" revision="2">
- <title>Preface</title>
+ <!--
+ <preface id="preface" revision="2"> <title>Preface</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="drools_logo.png" />
- </imageobject>
- </mediaobject>
+ <mediaobject> <imageobject> <imagedata fileref="drools_logo.png" />
+ </imageobject> </mediaobject> <para /> </preface>
+ -->
- <para />
- </preface>
--->
+ <xi:include href="Chapter-Rule_Engine/Chapter-Rule_Engine.xml" />
- <xi:include href="Chapter-Rule_Engine/Chapter-Rule_Engine.xml"/>
-
- <xi:include href="Chapter-Decision_Tables/Chapter-Spreadsheet.xml" />
-
-
- <xi:include href="Chapter-IDE/Chapter-QuickStart.xml" />
+ <xi:include href="Chapter-Decision_Tables/Chapter-Spreadsheet.xml" />
-
- <xi:include href="Chapter-Deployment/Chapter-DepymentAndTest.xml" />
- <xi:include href="Chapter-JSR94/Chapter-JSR94.xml" />
-
- <xi:include href="Chapter-Rule_Language/Chapter-RuleLanguage.xml" />
+ <xi:include href="Chapter-IDE/Chapter-QuickStart.xml" />
- <xi:include href="Chapter-Examples/Chapter-Examples.xml" />
- <index/>
+ <xi:include href="Chapter-Deployment/Chapter-DepymentAndTest.xml" />
+
+ <xi:include href="Chapter-JSR94/Chapter-JSR94.xml" />
+
+ <xi:include href="Chapter-Rule_Language/Chapter-RuleLanguage.xml" />
+
+ <xi:include href="Chapter-Examples/Chapter-Examples.xml" />
+
+ <index />
</book>
More information about the jboss-svn-commits
mailing list