[jboss-svn-commits] JBL Code SVN: r13601 - labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Jul 18 07:35:58 EDT 2007
Author: mark.proctor at jboss.com
Date: 2007-07-18 07:35:57 -0400 (Wed, 18 Jul 2007)
New Revision: 13601
Modified:
labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-Rule.xml
Log:
-added some text on what a Pattern is.
Modified: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-Rule.xml
===================================================================
--- labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-Rule.xml 2007-07-18 08:57:30 UTC (rev 13600)
+++ labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-Rule.xml 2007-07-18 11:35:57 UTC (rev 13601)
@@ -49,11 +49,12 @@
end</programlisting>
<section>
- <title>Left Hand Side</title>
+ <title id="RuleLanguage-LHS">Left Hand Side</title>
<para>The Left Hand Side (LHS) is a common name for the conditional part
of the rule. It consists of zero or more Conditional Elements; whch are
- covered in detail in a later secion of this Chapter. If the LHS is left
+ covered in detail in <xref lang=""
+ linkend="RuleLanguage-ConditionalElements" os="" />. If the LHS is left
empty it is re-written as eval(true), which means the rule is always
true.</para>
@@ -102,9 +103,9 @@
memory; without having to first reference a working memory
instance.</para>
- <para>"update(obj);" will tell the engine that an object has changed (one
- that has been bound to something on the LHS) and rules may need to be
- reconsidered.</para>
+ <para>"update(object, handle);" will tell the engine that an object has
+ changed (one that has been bound to something on the LHS) and rules may
+ need to be reconsidered.</para>
<para>"insert(new Something());" will place a new object of your creation
in working memory.</para>
@@ -113,7 +114,7 @@
object will be automatically retracted when there are no more facts to
support the truth of the currently firing rule.</para>
- <para>"retract(obj);" removes an object from working memory.</para>
+ <para>"retract(handle);" removes an object from working memory.</para>
<para>These convenience methods are basically macros that provide short
cuts to the KnowldgeHelper instance (refer to the KnowledgeHelper
@@ -127,7 +128,10 @@
<section>
<title>Rule Attriutes</title>
- <para />
+ <para>Rule attributes provide a declarative way to influence the behaviour
+ of the rule, some are quite simple, while others are part of complex sub
+ systems; such as ruleflow. To get the most from Drools you should make
+ sure you have a proper understanding of each attribute.</para>
<figure>
<title>rule attributes</title>
@@ -152,7 +156,8 @@
<para>When the Rule's consequence modifies a fact it may cause the Rule
to activate again, causing recursion. Setting no-loop to true means the
- attempt to create the Activation will be ignored.</para>
+ attempt to create the Activation for the current set of data will be
+ ignored.</para>
</section>
<section>
@@ -196,7 +201,7 @@
<section>
<title>activation-group</title>
- <para>default value N/A</para>
+ <para>default value : N/A</para>
<para>type : String</para>
@@ -212,6 +217,42 @@
</section>
<section>
+ <title>dialect</title>
+
+ <para>default value : as specified by the package</para>
+
+ <para>type : String</para>
+
+ <para>The dialect species the language to be used for any code
+ expressions in the LHS or the RHS code block. Currently two dialects are
+ available, Java and MVEL. While the dialect can be specified at the
+ package level, this attribute allows the package definition to be
+ overriden.</para>
+ </section>
+
+ <section>
+ <title>date-effective</title>
+
+ <para>default value : N/A</para>
+
+ <para>type : String, which contains a Date/Time definition</para>
+
+ <para>A rule can only activate if the current date and time is afer
+ date-effective attribute.</para>
+ </section>
+
+ <section>
+ <title>date-exptires</title>
+
+ <para>default value : N/A</para>
+
+ <para>type : String, which contains a Date/Time definition</para>
+
+ <para>A rule cannot activate if the current date and time is afer
+ date-expires attribute.</para>
+ </section>
+
+ <section>
<title>duration</title>
<para>default value : no default value</para>
@@ -235,6 +276,14 @@
<section>
<title>Pattern</title>
+ <para>As mentioned in <xref linkend="RuleLanguage-LHS" os="" /> the LHS is
+ made up of one or more Conditional Elements. The Pattern elment is the
+ most important Conditional Element and as such has it's own section. As
+ you already know a forward chaining rule engine is often referred to as a
+ Pattern Matching engine, because at the heart it matches the specified
+ Patterns against the available data. So lets take a look at what a Pattern
+ is.</para>
+
<figure>
<title>Pattern</title>
@@ -249,9 +298,28 @@
</mediaobject>
</figure>
+ <para>At the simplest, with no constraints, it simply matches against a
+ type, in the following casae the type is "Cheese". This meanst the pattern
+ will match against all Cheese objects in the working memory.</para>
+
<example>
<title>Pattern</title>
+ <programlisting>Cheese( )</programlisting>
+ </example>
+
+ <para>To be able to reference, from the consequence, the object that the
+ pattern matches against we use a pattern binding variable.</para>
+
+ <example>
+ <title>Pattern</title>
+
+ <programlisting>$c : Cheese( )</programlisting>
+ </example>
+
+ <example>
+ <title>Pattern</title>
+
<programlisting>Cheese( )
Cheese( type == "stilton", price < 10 )</programlisting>
</example>
@@ -723,7 +791,7 @@
</section>
</section>
- <section>
+ <section id="RuleLanguage-ConditionalElements">
<title>Conditional Elements</title>
<para>Conditional elements work on one or more Columns (which were
More information about the jboss-svn-commits
mailing list