[jboss-svn-commits] JBL Code SVN: r13277 - in labs/jbossrules/trunk/documentation/manual/en: Chapter-BRMS and 2 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Jul 9 17:42:50 EDT 2007


Author: fmeyer
Date: 2007-07-09 17:42:50 -0400 (Mon, 09 Jul 2007)
New Revision: 13277

Modified:
   labs/jbossrules/trunk/documentation/manual/en/Chapter-BRMS/Section-AdminGuide.xml
   labs/jbossrules/trunk/documentation/manual/en/Chapter-BRMS/Section-Architecture.xml
   labs/jbossrules/trunk/documentation/manual/en/Chapter-BRMS/Section-UserGuide.xml
   labs/jbossrules/trunk/documentation/manual/en/Chapter-IDE/Section-QuickStart.xml
   labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-XML.xml
   labs/jbossrules/trunk/documentation/manual/en/master.xml
Log:
Updated BRMS, corrected structure and added into master.xml 



Modified: labs/jbossrules/trunk/documentation/manual/en/Chapter-BRMS/Section-AdminGuide.xml
===================================================================
--- labs/jbossrules/trunk/documentation/manual/en/Chapter-BRMS/Section-AdminGuide.xml	2007-07-09 21:42:15 UTC (rev 13276)
+++ labs/jbossrules/trunk/documentation/manual/en/Chapter-BRMS/Section-AdminGuide.xml	2007-07-09 21:42:50 UTC (rev 13277)
@@ -108,7 +108,7 @@
       components.xml file in the WEB-INF directory. This is a JBoss Seam
       configuration file (Seam is the framework used) which allows various
       parts of the system to be customised. When you have located the
-      components.xml file, you should see something like the following:
+      components.xml file, you should see something like the following:</para>
       <programlisting>&lt;component name="repositoryConfiguration"&gt;
  &lt;!--
   *** This is for configuring the "home" directory for the repo storage. the directory must exist. ***
@@ -117,7 +117,7 @@
 
    ...
 &lt;/component&gt;
-</programlisting></para>
+</programlisting>
 
       <para>Find the component with a name of "repositoryConfiguration" and
       the property with the name of "homeDirectory".</para>
@@ -326,7 +326,7 @@
       of them forgetting are too terrible con contemplate).</para>
 
       <para>To achieve, this, you can "explode" the deployment war file, and
-      locate the JBRMS.html file. <programlisting>
+      locate the JBRMS.html file.</para> <programlisting>
 &lt;html&gt;
 &lt;head&gt;
   &lt;meta name='gwt:module' content='org.drools.brms.JBRMS'&gt;
@@ -341,7 +341,7 @@
   &lt;script language='javascript' src='gwt.js'&gt;&lt;/script&gt;
   &lt;iframe id='__gwt_historyFrame' style='width:0;height:0;border:0'&gt;&lt;/iframe&gt;
 &lt;/body&gt;
-&lt;/html&gt;</programlisting> The above is the contents of the JBRMS.html
+&lt;/html&gt;</programlisting><para> The above is the contents of the JBRMS.html
       file - it is faily empty (as most of the work is done by the GWT - the
       GUI is built dynamically in the browser). The parts you can customise
       are the style sheet - you can either edit the JBRMS.css (or better yet,

Modified: labs/jbossrules/trunk/documentation/manual/en/Chapter-BRMS/Section-Architecture.xml
===================================================================
--- labs/jbossrules/trunk/documentation/manual/en/Chapter-BRMS/Section-Architecture.xml	2007-07-09 21:42:15 UTC (rev 13276)
+++ labs/jbossrules/trunk/documentation/manual/en/Chapter-BRMS/Section-Architecture.xml	2007-07-09 21:42:50 UTC (rev 13277)
@@ -12,7 +12,7 @@
   <para>You may want to build from source if you want to re-use components, or
   embed the application in your own.</para>
 
-  <para><figure>
+  <figure>
       <title>Architectural diagram</title>
 
       <mediaobject>
@@ -21,7 +21,7 @@
                      scalefit="1" />
         </imageobject>
       </mediaobject>
-    </figure></para>
+    </figure>
 
   <para>The above diagram shows the major components of the system and how
   they integrate and are deployed. The Admin guide has more details on the

Modified: labs/jbossrules/trunk/documentation/manual/en/Chapter-BRMS/Section-UserGuide.xml
===================================================================
--- labs/jbossrules/trunk/documentation/manual/en/Chapter-BRMS/Section-UserGuide.xml	2007-07-09 21:42:15 UTC (rev 13276)
+++ labs/jbossrules/trunk/documentation/manual/en/Chapter-BRMS/Section-UserGuide.xml	2007-07-09 21:42:50 UTC (rev 13277)
@@ -2,6 +2,8 @@
 <!DOCTYPE section PUBLIC "-//OASIS//DTD Simplified DocBook XML V1.0//EN"
 "http://www.oasis-open.org/docbook/xml/simple/1.0/sdocbook.dtd">
 <section>
+
+    <title>Quick start guide</title>
   <section>
     <title>Quick start guide</title>
 
@@ -23,7 +25,7 @@
       </mediaobject>
     </figure>
 
-    <para>The above picture shows the main feature areas of the BRMS.
+    <para>The above picture shows the main feature areas of the BRMS.</para>
     <itemizedlist>
         <listitem>
           <para>Info: This is the initial screen, with links to
@@ -49,7 +51,7 @@
           <para>Admin: Administrative functions (categories, statuses, import
           and export)</para>
         </listitem>
-      </itemizedlist></para>
+      </itemizedlist>
 
     <para>You can also consult the wiki:
     http://wiki.jboss.org/wiki/Wiki.jsp?page=RulesRepository for some
@@ -279,7 +281,7 @@
       item in the version history. Changing the categories of a rule has no
       effect on its execution.</para>
 
-      <para><figure>
+      <figure>
           <title>Creating categories</title>
 
           <mediaobject>
@@ -288,7 +290,7 @@
                          scalefit="1" />
             </imageobject>
           </mediaobject>
-        </figure> The above view shows the administration screen for setting
+        </figure> <para> The above view shows the administration screen for setting
       up categories (there) are no categories in the system by default. As the
       categories can be hierachical you chose the "parent" category that you
       want to create a sub-category for. From here categories can also be
@@ -306,7 +308,7 @@
     <section>
       <title>The asset editor</title>
 
-      <para><figure>
+      <figure>
           <title>The Asset editor view</title>
 
           <mediaobject>
@@ -315,9 +317,9 @@
                          scalefit="1" />
             </imageobject>
           </mediaobject>
-        </figure> The above diagram shows the "asset editor" with some
+        </figure> <para> The above diagram shows the "asset editor" with some
       annotated areas. The asset editor is where all rule changes are made.
-      Below is a list which describes the different parts of the editor.
+      Below is a list which describes the different parts of the editor.</para>
       <itemizedlist>
           <listitem>
             <para>A</para>
@@ -394,7 +396,7 @@
             <para>This will show the version history list when
             requested.</para>
           </listitem>
-        </itemizedlist></para>
+        </itemizedlist>
     </section>
 
     <section>
@@ -427,7 +429,7 @@
       the lifecycle of assets (which you can alternatively do with categories
       if you like).</para>
 
-      <para><figure>
+      <figure>
           <title>Asset status</title>
 
           <mediaobject>
@@ -436,11 +438,11 @@
                          format="PNG" scalefit="1" />
             </imageobject>
           </mediaobject>
-        </figure> You can change the status of an individual asset (like in
+        </figure><para> You can change the status of an individual asset (like in
       the diagram above). Its change takes effect immediately, no seperate
       save is needed.</para>
 
-      <para><figure>
+      <figure>
           <title>Asset status</title>
 
           <mediaobject>
@@ -449,7 +451,7 @@
                          format="PNG" scalefit="1" />
             </imageobject>
           </mediaobject>
-        </figure> You can change the status of a whole package - this sets the
+        </figure><para> You can change the status of a whole package - this sets the
       status flag on the package itself, but it ALSO changes the statuses on
       ALL the assets that belong to this package in one hit (to be the same as
       what you set the package to).</para>
@@ -471,7 +473,7 @@
       snapshot (typically which is used for deployment). The next section
       talks about deployment management and snapshots.</para>
 
-      <para><figure>
+      <figure>
           <title>Asset versions</title>
 
           <mediaobject>
@@ -480,7 +482,7 @@
                          format="PNG" scalefit="1" />
             </imageobject>
           </mediaobject>
-        </figure> Each time you make a change to an asset, it creates a new
+        </figure> <para> Each time you make a change to an asset, it creates a new
       item in the version history. This is a bit like having an unlimited
       undo. You can look back through the history of an individual asset like
       the list above, and view it (and restore it) from that point in
@@ -586,7 +588,7 @@
       your classpath. You can also pass in a Properties object with the
       parameters set up (the parameters are discussed next).</para>
 
-      <para>The following shows the content of MyRules.properties:
+      <para>The following shows the content of MyRules.properties: </para>
       <programlisting>##
 ## RuleAgent configuration file example
 ##
@@ -599,13 +601,13 @@
 poll=30
 
 
-name=MyConfig</programlisting></para>
+name=MyConfig</programlisting>
 
       <para>You can only have one type of key in each configuration (eg only
       one "file", "dir" etc - even though you can specify multiple items by
       space separating them).</para>
 
-      <para>Referring to the above example, the "keys" in the properties are:
+      <para>Referring to the above example, the "keys" in the properties are:</para>
       <itemizedlist>
           <listitem>
             <para>newInstance</para>
@@ -668,10 +670,11 @@
             when logging events (as typically you would have multiple agents
             in a system).</para>
           </listitem>
-        </itemizedlist></para>
+        </itemizedlist>
 
       <para>Following shows the deployment screen of the BRMS, which provides
-      URLs and downloads of packages. <figure>
+      URLs and downloads of packages. </para>
+        <figure>
           <title>Snapshot deployment</title>
 
           <mediaobject>
@@ -680,7 +683,7 @@
                          format="PNG" scalefit="1" />
             </imageobject>
           </mediaobject>
-        </figure></para>
+        </figure>
 
       <para>You can see the "Package URI" - this is the URL that you would
       copy and paste into the agent .properties file to specify that you want

Modified: labs/jbossrules/trunk/documentation/manual/en/Chapter-IDE/Section-QuickStart.xml
===================================================================
--- labs/jbossrules/trunk/documentation/manual/en/Chapter-IDE/Section-QuickStart.xml	2007-07-09 21:42:15 UTC (rev 13276)
+++ labs/jbossrules/trunk/documentation/manual/en/Chapter-IDE/Section-QuickStart.xml	2007-07-09 21:42:50 UTC (rev 13277)
@@ -161,7 +161,7 @@
           <imagedata align="center" fileref="wizards.jpg" format="JPG" />
         </imageobject>
       </mediaobject>
-    </figure>
+	    </figure>
 
     <para>The wizard will ask for some basic options for generating a rule
     resource. These are just hints, you can change your mind later !. In terms
@@ -576,99 +576,104 @@
     with each change, which may provide performance improvements if your IDE
     becomes sluggish with very large numbers of rules.</para>
   </section>
-  
-  <section>
-    <title>Debugging rules</title>
 
-    <para>You can debug rules during the execution of your Drools application.
-    You can add breakpoints in the consequences of your rules, and whenever
-    such a breakpoint is encounted during the execution of the rules, the execution
-    is halted.  You can then inspect the variables known at that point and use any
-    of the default debugging actions to decide what should happen next (step over,
-    continue, etc.).  You can also use the debug views to inspect the content of the
-    working memory and agenda.</para>
 
-   <title>Creating breakpoints</title>
-   <para>You can add/remove rule breakpoints in drl files in two ways, similar to adding
-   breakpoints to Java files:</para>
-    <itemizedlist>
-      <listitem>
-        <para>Double-click the ruler of the DRL editor at the line where you want to
-        add a breakpoint.  Note that rule breakpoints can only be created in the
-        consequence of a rule.  Double-clicking on a line where no breakpoint is allowed
-        will do nothing.  A breakpoint can be removed by double-clicking the ruler once more.
-        </para>
-      </listitem>
-      <listitem>
-        <para>If you right-click the ruler, a popup menu will show up, containing the 
-        "Toggle breakpoint" action.  Note that rule breakpoints can only be created in the
-        consequence of a rule.  The action is automatically disabled if no rule
-        breakpoint is allowed at that line.  Clicking the action will add a breakpoint at the
-        selected line, or remove it if there was one already.</para>
-      </listitem>
-   </itemizedlist>
-   <para>The Debug Perspective contains a Breakpoints view which can be used to see
-   all defined breakpoints, get their properties, enable/disable or remove them, etc.</para>
-    
-   <title>Debugging rules</title>
-   <para>Drools breakpoints are only enabled if you debug your application as
-    a Drools Application.  You can do this like this:</para>
-    <itemizedlist>
-      <listitem>
-        <para>Select the main class of your application. Right click it and select the
-        "Debug As >" sub-menu.  There, select the "Debug ..." menu item to open a
-        new dialog for creating, managing and running debug configurations (see
-        screenshot below)</para>
-      </listitem>
-      <listitem>
-        <para>Select the "JBoss Rules Application" item in the left tree and click the "New
-        launch configuration" button (leftmost icon in the toolbar above the tree).  This
-        will create a new configuration and already fill in some of the properties
-        (like the project and main class) based on main class you selected in the beginning.
-        All properties shown here are the same as any standard Java program.</para>
-      </listitem>
-      <listitem>
-        <para>Change the name of your debug configuration to something meaningful.
-        You can just accept the defaults for all other properties.  For more information
-        about these properties, please check the eclipse jdt documentation.</para>
-      </listitem>
-      <listitem>
-        <para>Click the "Debug" button on the botton to start debugging your application.
-        </para>
-      </listitem>
-   </itemizedlist>
-   
-    <mediaobject>
-      <imageobject>
-        <imagedata fileref="debug_rules_configuration.JPG" />
-      </imageobject>
-    </mediaobject>
+    <section>
 
-   <para>You only have to define your debug configuration once.  The next time you try to run your
-   JBoss Rules application, you don't have to create a new one but select the one you defined
-   previously by selecting it in the tree on the left, as a sub-element of the "JBoss Rules Application"
-   tree node, and then click the Debug button.  The eclipse toolbar also contains shortcut
-   buttons to quickly re-execute the one of your previous configurations (at least when the
-   Java, Java Debug, or JBoss Rules perspective has been selected).
-   </para>
+      <title>Debugging rules</title>
 
-   <para>After clicking the "Debug" button, the application starts executing and will halt if any
-   breakpoint is encountered.  This can be a Drools rule breakpoint, or any other standard
-   Java breakpoint.  Whenever a Drools rule breakpoint is encountered, the corresponding drl
-   file is opened and the active line is highlighted.  The Variables view also contains all rule
-   parameters and their value.You can then use the default Java debug actions
-   to decide what to do next (resume, terminate, step over, etc.).  The debug views can also
-   be used to determine the contents of the working memory and agenda at that time as well
-   (you don't have to select a working memory now, the current executing working memory
-   is automatically shown).
-   </para>
+      <para>You can debug rules during the execution of your Drools application.
+      You can add breakpoints in the consequences of your rules, and whenever
+      such a breakpoint is encounted during the execution of the rules, the execution
+      is halted.  You can then inspect the variables known at that point and use any
+      of the default debugging actions to decide what should happen next (step over,
+      continue, etc.).  You can also use the debug views to inspect the content of the
+      working memory and agenda.</para>
 
-    <mediaobject>
-      <imageobject>
-        <imagedata fileref="debug_rules_configuration.JPG" />
-      </imageobject>
-    </mediaobject>
+<section>
+     <title>Creating breakpoints</title>
+     <para>You can add/remove rule breakpoints in drl files in two ways, similar to adding
+     breakpoints to Java files:</para>
+      <itemizedlist>
+        <listitem>
+          <para>Double-click the ruler of the DRL editor at the line where you want to
+          add a breakpoint.  Note that rule breakpoints can only be created in the
+          consequence of a rule.  Double-clicking on a line where no breakpoint is allowed
+          will do nothing.  A breakpoint can be removed by double-clicking the ruler once more.
+          </para>
+        </listitem>
+        <listitem>
+          <para>If you right-click the ruler, a popup menu will show up, containing the
+          "Toggle breakpoint" action.  Note that rule breakpoints can only be created in the
+          consequence of a rule.  The action is automatically disabled if no rule
+          breakpoint is allowed at that line.  Clicking the action will add a breakpoint at the
+          selected line, or remove it if there was one already.</para>
+        </listitem>
+     </itemizedlist>
+     <para>The Debug Perspective contains a Breakpoints view which can be used to see
+     all defined breakpoints, get their properties, enable/disable or remove them, etc.</para>
+</section>
+<section>
+     <title>Debugging rules</title>
+     <para>Drools breakpoints are only enabled if you debug your application as
+      a Drools Application.  You can do this like this:</para>
+      <itemizedlist>
+        <listitem>
+          <para>Select the main class of your application. Right click it and select the
+          "Debug As >" sub-menu.  There, select the "Debug ..." menu item to open a
+          new dialog for creating, managing and running debug configurations (see
+          screenshot below)</para>
+        </listitem>
+        <listitem>
+          <para>Select the "JBoss Rules Application" item in the left tree and click the "New
+          launch configuration" button (leftmost icon in the toolbar above the tree).  This
+          will create a new configuration and already fill in some of the properties
+          (like the project and main class) based on main class you selected in the beginning.
+          All properties shown here are the same as any standard Java program.</para>
+        </listitem>
+        <listitem>
+          <para>Change the name of your debug configuration to something meaningful.
+          You can just accept the defaults for all other properties.  For more information
+          about these properties, please check the eclipse jdt documentation.</para>
+        </listitem>
+        <listitem>
+          <para>Click the "Debug" button on the botton to start debugging your application.
+          </para>
+        </listitem>
+     </itemizedlist>
 
-  </section>
-    
-</section>
\ No newline at end of file
+      <mediaobject>
+        <imageobject>
+          <imagedata fileref="debug_rules_configuration.JPG" />
+        </imageobject>
+      </mediaobject>
+
+     <para>You only have to define your debug configuration once.  The next time you try to run your
+     JBoss Rules application, you don't have to create a new one but select the one you defined
+     previously by selecting it in the tree on the left, as a sub-element of the "JBoss Rules Application"
+     tree node, and then click the Debug button.  The eclipse toolbar also contains shortcut
+     buttons to quickly re-execute the one of your previous configurations (at least when the
+     Java, Java Debug, or JBoss Rules perspective has been selected).
+     </para>
+
+     <para>After clicking the "Debug" button, the application starts executing and will halt if any
+     breakpoint is encountered.  This can be a Drools rule breakpoint, or any other standard
+     Java breakpoint.  Whenever a Drools rule breakpoint is encountered, the corresponding drl
+     file is opened and the active line is highlighted.  The Variables view also contains all rule
+     parameters and their value.You can then use the default Java debug actions
+     to decide what to do next (resume, terminate, step over, etc.).  The debug views can also
+     be used to determine the contents of the working memory and agenda at that time as well
+     (you don't have to select a working memory now, the current executing working memory
+     is automatically shown).
+     </para>
+
+      <mediaobject>
+        <imageobject>
+          <imagedata fileref="debug_rules_configuration.JPG" />
+        </imageobject>
+      </mediaobject>
+    </section>
+    </section>
+
+
+</section>

Modified: labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-XML.xml
===================================================================
--- labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-XML.xml	2007-07-09 21:42:15 UTC (rev 13276)
+++ labs/jbossrules/trunk/documentation/manual/en/Chapter-Rule_Language/Section-XML.xml	2007-07-09 21:42:50 UTC (rev 13277)
@@ -20,11 +20,11 @@
     rules.</para>
 
     <para>If you do want to edit XML by hand, use a good schema aware editor
-    that provides nice heirarchical views of the XML, ideally visually
+    that provides nice hierarchical views of the XML, ideally visually
     (commercial tools like XMLSpy, Oxygen etc are good, but cost money, but
     then so do headache tablets).</para>
 
-    <para>Other scenarious where you may want to use the XML format are if you
+    <para>Other scenarios where you may want to use the XML format are if you
     have a tool that generates rules from some input (programmatically
     generated rules), or perhaps interchange from another rule language, or
     from another tool that emits XML (using XSLT you can easily transform
@@ -51,11 +51,12 @@
         </indexterm></title>
 
       <programlisting>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
+
 &lt;package name="com.sample"
-         xmlns="http://drools.org/drools-3.0"
+         xmlns="http://drools.org/drools-4.0"
          xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
-         xs:schemaLocation="http://drools.org/drools-3.0 drools-3.0.xsd"&gt;
-         
+         xs:schemaLocation="http://drools.org/drools-4.0 drools-4.0.xsd"&gt;
+
 &lt;import name="java.util.HashMap" /&gt;
 &lt;import name="org.drools.*" /&gt;
 
@@ -65,32 +66,144 @@
 &lt;function return-type="void" name="myFunc"&gt;
     &lt;parameter identifier="foo" type="Bar" /&gt;
     &lt;parameter identifier="bada" type="Bing" /&gt;
-        
+
     &lt;body&gt;
-        System.out.println("hello world");
+     System.out.println("hello world");
     &lt;/body&gt;
 &lt;/function&gt;
 
-&lt;rule name="my rule"&gt;
-  &lt;rule-attribute name="salience" value="10" /&gt;
+&lt;rule name="simple_rule"&gt;
+&lt;rule-attribute name="salience" value="10" /&gt;
+&lt;rule-attribute name="no-loop" value="true" /&gt;
+&lt;rule-attribute name="agenda-group" value="agenda-group" /&gt;
+&lt;rule-attribute name="activation-group" value="activation-group" /&gt;
 
-  &lt;lhs&gt;
-       &lt;column object-type="Foo" /&gt;
+&lt;lhs&gt;
+		&lt;pattern identifier="foo2" object-type="Bar" &gt;
+            &lt;or-constraint-connective&gt;
+                &lt;and-constraint-connective&gt;
+                    &lt;field-constraint field-name="a"&gt;
+                        &lt;or-restriction-connective&gt;
+                            &lt;and-restriction-connective&gt;
+                                &lt;literal-restriction evaluator="&gt;" value="60" /&gt;
+                                &lt;literal-restriction evaluator="&lt;" value="70" /&gt;
+                            &lt;/and-restriction-connective&gt;
+                            &lt;and-restriction-connective&gt;
+                                &lt;literal-restriction evaluator="&lt;" value="50" /&gt;
+                                &lt;literal-restriction evaluator="&gt;" value="55" /&gt;
+                            &lt;/and-restriction-connective&gt;
+                        &lt;/or-restriction-connective&gt;
+                    &lt;/field-constraint&gt;
+
+                    &lt;field-constraint field-name="a3"&gt;
+                        &lt;literal-restriction evaluator="==" value="black" /&gt;
+                    &lt;/field-constraint&gt;
+                &lt;/and-constraint-connective&gt;
+
+                &lt;and-constraint-connective&gt;
+                    &lt;field-constraint field-name="a"&gt;
+                        &lt;literal-restriction evaluator="==" value="40" /&gt;
+                    &lt;/field-constraint&gt;
+
+                    &lt;field-constraint field-name="a3"&gt;
+                        &lt;literal-restriction evaluator="==" value="pink" /&gt;
+                    &lt;/field-constraint&gt;
+                &lt;/and-constraint-connective&gt;
+
+                &lt;and-constraint-connective&gt;
+                    &lt;field-constraint field-name="a"&gt;
+                        &lt;literal-restriction evaluator="==" value="12"/&gt;
+                    &lt;/field-constraint&gt;
+
+                    &lt;field-constraint field-name="a3"&gt;
+                        &lt;or-restriction-connective&gt;
+                            &lt;literal-restriction evaluator="==" value="yellow"/&gt;
+                            &lt;literal-restriction evaluator="==" value="blue" /&gt;
+                        &lt;/or-restriction-connective&gt;
+                    &lt;/field-constraint&gt;
+                &lt;/and-constraint-connective&gt;
+            &lt;/or-constraint-connective&gt;
+        &lt;/pattern&gt;
+
+        &lt;not&gt;
+            &lt;pattern object-type="Person"&gt;
+                &lt;field-constraint field-name="likes"&gt;
+                    &lt;variable-restriction evaluator="==" identifier="type"/&gt;
+                &lt;/field-constraint&gt;
+            &lt;/pattern&gt;
+
+            &lt;exists&gt;
+                &lt;pattern object-type="Person"&gt;
+                    &lt;field-constraint field-name="likes"&gt;
+                        &lt;variable-restriction evaluator="==" identifier="type"/&gt;
+                    &lt;/field-constraint&gt;
+                &lt;/pattern&gt;                
+            &lt;/exists&gt;
+        &lt;/not&gt;
+
+        &lt;or-conditional-element&gt;
+            &lt;pattern identifier="foo3" object-type="Bar" &gt;
+                &lt;field-constraint field-name="a"&gt;
+                    &lt;or-restriction-connective&gt;
+                        &lt;literal-restriction evaluator="==" value="3" /&gt;
+                        &lt;literal-restriction evaluator="==" value="4" /&gt;
+                    &lt;/or-restriction-connective&gt;
+                &lt;/field-constraint&gt;
+                &lt;field-constraint field-name="a3"&gt;
+                    &lt;literal-restriction evaluator="==" value="hello" /&gt;
+                &lt;/field-constraint&gt;
+                &lt;field-constraint field-name="a4"&gt;
+                    &lt;literal-restriction evaluator="==" value="null" /&gt;
+                &lt;/field-constraint&gt;
+            &lt;/pattern&gt;
+
+            &lt;pattern identifier="foo4" object-type="Bar" &gt;
+                &lt;field-binding field-name="a" identifier="a4" /&gt;
+                &lt;field-constraint field-name="a"&gt;
+                    &lt;literal-restriction evaluator="!=" value="4" /&gt;
+                    &lt;literal-restriction evaluator="!=" value="5" /&gt;
+                &lt;/field-constraint&gt;
+            &lt;/pattern&gt;
+        &lt;/or-conditional-element&gt;
+
+        &lt;pattern identifier="foo5" object-type="Bar" &gt;
+            &lt;field-constraint field-name="b"&gt;
+                &lt;or-restriction-connective&gt;
+                    &lt;return-value-restriction evaluator="==" &gt;a4 + 1&lt;/return-value-restriction&gt;
+                    &lt;variable-restriction evaluator="&gt;" identifier="a4" /&gt;
+                    &lt;qualified-identifier-restriction evaluator="=="&gt;
+                        org.drools.Bar.BAR_ENUM_VALUE
+                    &lt;/qualified-identifier-restriction&gt;
+                &lt;/or-restriction-connective&gt;
+            &lt;/field-constraint&gt;            
+        &lt;/pattern&gt;
+
+        &lt;pattern identifier="foo6" object-type="Bar" &gt;
+            &lt;field-binding field-name="a" identifier="a4" /&gt;
+            &lt;field-constraint field-name="b"&gt;
+                &lt;literal-restriction evaluator="==" value="6" /&gt;
+            &lt;/field-constraint&gt;
+        &lt;/pattern&gt;
   &lt;/lhs&gt;
+ &lt;rhs&gt;
+    if ( a == b ) {
+      assert( foo3 );
+    } else {
+      retract( foo4 );
+    }
+    System.out.println( a4 );
+   &lt;/rhs&gt;
+&lt;/rule&gt;
 
-  &lt;rhs&gt;
-    System.out.println( "hello" );    
-&lt;/rhs&gt;
-&lt;/rule&gt;
 &lt;/package&gt;
+	
 </programlisting>
     </example>
 
     <para>Referring to the above example: Notice the key parts, the
-    declaration for the Drools 3, schema, imports, globals (application-data
-    in drools 2), functions, and the rules. Most of the elements are self
-    explanatory if you have some understanding of the Drools 3
-    features.</para>
+    declaration for the Drools 4, schema, imports, globals, functions, and the
+    rules. Most of the elements are self explanatory if you have some
+    understanding of the Drools 4 features.</para>
 
     <para>Imports: import the types you wish to use in the rule.</para>
 
@@ -106,52 +219,44 @@
     <example>
       <title>Detail of rule element</title>
 
-      <programlisting>&lt;rule name="my rule"&gt;
- &lt;lhs&gt;
+      <programlisting>&lt;rule name="simple_rule"&gt;
+&lt;rule-attribute name="salience" value="10" /&gt;
+&lt;rule-attribute name="no-loop" value="true" /&gt;
+&lt;rule-attribute name="agenda-group" value="agenda-group" /&gt;
+&lt;rule-attribute name="activation-group" value="activation-group" /&gt;
 
-  &lt;column object-type="Foo" /&gt;
-  &lt;column identifier="bar" object-type="Bar" /&gt;
+&lt;lhs&gt;
+    &lt;pattern identifier="cheese" object-type="Cheese"&gt;
+        &lt;from&gt;
+            &lt;accumulate&gt;
+                &lt;pattern object-type="Person"&gt;&lt;/pattern&gt;
+                &lt;init&gt;
+                    int total = 0;
+                &lt;/init&gt;
+                &lt;action&gt;
+                    total += $cheese.getPrice();
+                &lt;/action&gt;
+                &lt;result&gt;
+                    new Integer( total ) );
+                &lt;/result&gt;
+            &lt;/accumulate&gt;
+        &lt;/from&gt;
+    &lt;/pattern&gt;
 
-  &lt;column object-type="Foo"&gt;
-    &lt;literal field-name="field1" evaluator="==" value="value1" /&gt;
-    &lt;predicate field-name="field1" identifier="var1" expression="1==1" /&gt;
-    &lt;return-value field-name="field1" evaluator="==" expression="1==1" /&gt;
-    &lt;field-binding field-name="field1" identifier="var1" /&gt;
-    &lt;bound-variable field-name="field1" evaluator="==" identifier="var1" /&gt;
-  &lt;/column&gt;
-
-  &lt;not&gt;
-    &lt;column object-type="Bar" /&gt;
-  &lt;/not&gt;
-
-  &lt;exists&gt;
-    &lt;column object-type="Bar" /&gt;
-  &lt;/exists&gt;
-
-  &lt;and&gt;
-    &lt;or&gt;
-      &lt;column object-type="Bar" /&gt;
-    &lt;/or&gt;
-    &lt;column object-type="Yada" /&gt;
-  &lt;/and&gt;
-
-  &lt;or&gt;
-    &lt;and&gt;
-      &lt;column object-type="Foo" /&gt;
-    &lt;/and&gt;
-    &lt;column object-type="Zaa" /&gt;
-  &lt;/or&gt;
-
-  &lt;eval&gt;
-    1==1
-  &lt;/eval&gt;
- &lt;/lhs&gt;
-
- &lt;rhs&gt;
-   /* semantic actions here */
- &lt;/rhs&gt;
+    &lt;pattern identifier="max" object-type="Number"&gt;
+        &lt;from&gt;
+            &lt;accumulate&gt;
+                &lt;pattern identifier="cheese" object-type="Cheese"&gt;&lt;/pattern&gt;
+                &lt;external-function evaluator="max" expression="$price"/&gt;
+            &lt;/accumulate&gt;
+        &lt;/from&gt;
+    &lt;/pattern&gt;
+&lt;/lhs&gt;
+&lt;rhs&gt;
+    list1.add( $cheese );
+&lt;/rhs&gt;
 &lt;/rule&gt;
-</programlisting>
+	</programlisting>
     </example>
 
     <para>Referring to the above rule detail:</para>
@@ -159,19 +264,30 @@
     <para>The rule has a LHS and RHS (conditions and consequence) sections.
     The RHS is simple, it is just a block of semantic code that will be
     executed when the rule is activated. The LHS is slightly more complicated,
-    certainly more so then Drools 2.x.</para>
+    certainly more so then past versions.</para>
 
-    <para>A key element of the LHS is the Column element. This allows you to
+
+<!--
+	TODO: explain about 
+	
+	conditional-element 
+	constraint-connective
+	restriction-connective
+	
+	accumulate and external functions
+-->
+
+    <para>A key element of the LHS is the Pattern element. This allows you to
     specify a type (class) and perhaps bind a variable to an instance of that
-    class. Nested under the column object are constraints that have to be met.
-    The Predicate and Return Value constraints allow java expressions to be
-    embedded.</para>
+    class. Nested under the pattern object are constraints and conditional
+	elements that have to be met. The Predicate and Return Value constraints 
+	allow java expressions to be embedded.</para>
 
     <para>That leaves the conditional elements, not, exists, and, or etc. They
     work like their DRL counterparts. Elements that are nested under and an
     "and" element are logically "anded" together. Likewise with "or" (and you
-    can nest things further). "Exists" and "Not" work around Columns, to check
-    for the existence or non existance of a fact meeting its
+    can nest things further). "Exists" and "Not" work around Patterns, to check
+    for the existence or non existence of a fact meeting its
     constraints.</para>
 
     <para>The Eval element allows the execution of a valid snippet of java
@@ -184,61 +300,7 @@
 
   <section>
     <title>Legacy Drools 2.x XML rule format</title>
-
-    <para>The Drools 2.x legacy XML format is somewhat different to the Drools
-    3 format that you can see above.</para>
-
-    <para>However, there are some similarities. Basically the imports, globals
-    (which replace application-data in drools 2.x) work the same. Functions
-    are also similar, except that they are specified one at a time (in Drools
-    2 they where specified in a single block).</para>
-
-    <para />
-
-    <example>
-      <title>Drools 2.x xml</title>
-
-      <programlisting>  &lt;rule name="Goodbye Cruel World"&gt;
-    &lt;parameter identifier="goodbye"&gt;
-      &lt;class&gt;String&lt;/class&gt;
-    &lt;/parameter&gt;
-
-    &lt;java:condition&gt;goodbye.equals("Goodbye")&lt;/java:condition&gt;
-
-    &lt;java:consequence&gt;
-      goodbyeWorld( goodbye );
-    &lt;/java:consequence&gt;
-  &lt;/rule&gt;</programlisting>
-    </example>
-
-    <section>
-      <title>Migrating to Drools 3</title>
-
-      <para>It is possible generally to migrate from drools 2 to drools 3 XML
-      format, if you have existing rulebases you want to port to drools 3.
-      This may be done with a stylesheet, possibly. Note that Drools 2.x DSLs
-      will not be trivial to port to drools 3 XML. You would be best to look
-      at the new DSL features in Drools 3 DRL.</para>
-
-      <para>Note that while "eval" allows you to more or less directly migrate
-      your conditions from Drools 2.x to 3, it is far more powerful, and
-      performant, to use constraints on columns where possible, as it utilises
-      the full power of the engine.</para>
-
-      <example>
-        <title>Drools 3 XML equivalent</title>
-
-        <programlisting>&lt;rule name="Goodbye Cruel World"&gt;
- &lt;lhs&gt;
-   &lt;column identifier='goodbye' object-type='String' &gt;
-   &lt;eval&gt;goodbye.equals("Goodbye")&lt;/eval&gt;
- &lt;/lhs&gt;
- &lt;rhs&gt;
-   goodbyeWorld( goodbye );
- &lt;/rhs&gt;
-&lt;/rule&gt;</programlisting>
-      </example>
-    </section>
+    <para>The Drools 2.x legacy XML format is no longer supported by Drools XML parser</para>
   </section>
 
   <section>

Modified: labs/jbossrules/trunk/documentation/manual/en/master.xml
===================================================================
--- labs/jbossrules/trunk/documentation/manual/en/master.xml	2007-07-09 21:42:15 UTC (rev 13276)
+++ labs/jbossrules/trunk/documentation/manual/en/master.xml	2007-07-09 21:42:50 UTC (rev 13277)
@@ -145,6 +145,10 @@
       <xi:include href="Chapter-BRMS/Section-Introduction.xml" />
 
       <xi:include href="Chapter-BRMS/Section-AdminGuide.xml" />
+
+      <xi:include href="Chapter-BRMS/Section-Architecture.xml" />
+
+      <xi:include href="Chapter-BRMS/Section-UserGuide.xml" />
     </chapter>
 
     <chapter>




More information about the jboss-svn-commits mailing list