[jboss-svn-commits] JBL Code SVN: r14432 - labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Tue Aug 21 23:41:12 EDT 2007


Author: michael.neale at jboss.com
Date: 2007-08-21 23:41:12 -0400 (Tue, 21 Aug 2007)
New Revision: 14432

Modified:
   labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-Conditional_Elements.xml
   labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-Rule.xml
Log:
JBRULES-1083

Modified: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-Conditional_Elements.xml
===================================================================
--- labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-Conditional_Elements.xml	2007-08-22 02:43:38 UTC (rev 14431)
+++ labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-Conditional_Elements.xml	2007-08-22 03:41:12 UTC (rev 14432)
@@ -24,13 +24,11 @@
 
       <mediaobject>
         <imageobject>
-          <imagedata align="center" fileref="eval.svg" format="SVG" role=""
-                      />
+          <imagedata align="center" fileref="eval.svg" format="SVG" role="" />
         </imageobject>
 
         <imageobject>
-          <imagedata align="center" fileref="eval.png" format="PNG" role=""
-                      />
+          <imagedata align="center" fileref="eval.png" format="PNG" role="" />
         </imageobject>
       </mediaobject>
     </figure>
@@ -46,18 +44,17 @@
 
       <mediaobject>
         <imageobject>
-          <imagedata align="center" fileref="notl.svg" format="SVG" role=""
-                      />
+          <imagedata align="center" fileref="notl.svg" format="SVG" role="" />
         </imageobject>
 
         <imageobject>
-          <imagedata align="center" fileref="not.png" format="PNG" role=""
-                      />
+          <imagedata align="center" fileref="not.png" format="PNG" role="" />
         </imageobject>
       </mediaobject>
     </figure>
 
-    <para></para>
+    <para>Note that brackets are only optional for single patterns (ie the
+    conditional element is a single pattern like "Bus()".</para>
   </section>
 
   <section>
@@ -68,13 +65,11 @@
 
       <mediaobject>
         <imageobject>
-          <imagedata align="center" fileref="existsl.svg" format="SVG" role=""
-                      />
+          <imagedata align="center" fileref="existsl.svg" format="SVG" role="" />
         </imageobject>
 
         <imageobject>
-          <imagedata align="center" fileref="exists.png" format="PNG" role=""
-                      />
+          <imagedata align="center" fileref="exists.png" format="PNG" role="" />
         </imageobject>
       </mediaobject>
     </figure>

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-08-22 02:43:38 UTC (rev 14431)
+++ labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-Rule.xml	2007-08-22 03:41:12 UTC (rev 14432)
@@ -456,7 +456,7 @@
       <para>Also, it is important to note that besides having the same
       semantics, the connectives '&amp;&amp;' and ',' are resolved with
       different priorities and ',' cannot be embedded in a composite
-      constraint expression. </para>
+      constraint expression.</para>
 
       <example>
         <title>Not Equivalent connectives</title>
@@ -1130,10 +1130,10 @@
       <title>'and'</title>
 
       <para>The 'and' Conditional Element is used to group together other
-      Conditional Elements. The root element of the LHS is an implicit
-      prefix And and doesn't need to be specified. Drools supports both prefix
-      and infix; although prefix is the preferred option as grouping is
-      implicit which avoids confusion.</para>
+      Conditional Elements. The root element of the LHS is an implicit prefix
+      And and doesn't need to be specified. Drools supports both prefix and
+      infix; although prefix is the preferred option as grouping is implicit
+      which avoids confusion.</para>
 
       <figure>
         <title>prefixAnd</title>
@@ -1356,9 +1356,13 @@
       </figure>
 
       <para>'not' is first order logic's Non-Existential Quantifier and checks
-      for the non existence of something in the Working Memory. Brackets are
-      optional. Think of 'not' as meaning "there must be none of...".</para>
+      for the non existence of something in the Working Memory. Think of 'not'
+      as meaning "there must be none of...".</para>
 
+      <para>A not statement must be followed by parentheses around the pattern
+      that it applies to. In the simples case of a single pattern (like below)
+      you can omit the parentheses.</para>
+
       <example>
         <title>No Busses</title>
 
@@ -1368,9 +1372,10 @@
       <example>
         <title>No red Busses</title>
 
-        <programlisting>not Bus(color == "red")
-not ( Bus(color == "red", number == 42) ) //brackets are optional
-not ( Bus(color == "red") and Bus(color == "blue")) // not with nested 'and' infix used here as ony two patterns</programlisting>
+        <programlisting>not Bus(color == "red") //brackets are optional for this simple pattern
+not ( Bus(color == "red", number == 42) ) //brackets are optional for this simple case
+not ( Bus(color == "red") and Bus(color == "blue")) // not with nested 'and' infix used here as ony two patterns 
+                                                      (but brackets are required).</programlisting>
       </example>
     </section>
 
@@ -1449,7 +1454,7 @@
       <para>In the above rule, we "select" all Bus object whose type is
       "english". Then, for each fact that matches this pattern we evaluate the
       following patterns and if they match, the forall CE will evaluate to
-      true. </para>
+      true.</para>
 
       <para>To state that all facts of a given type in the working memory must
       match a set of constraints, forall can be written with a single pattern




More information about the jboss-svn-commits mailing list