[jboss-svn-commits] JBL Code SVN: r26098 - labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-User_Guide.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Fri Apr 17 05:36:57 EDT 2009


Author: laune
Date: 2009-04-17 05:36:57 -0400 (Fri, 17 Apr 2009)
New Revision: 26098

Modified:
   labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-User_Guide/Section-Building.xml
Log:
improvements

Modified: labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-User_Guide/Section-Building.xml
===================================================================
--- labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-User_Guide/Section-Building.xml	2009-04-17 09:36:33 UTC (rev 26097)
+++ labs/jbossrules/trunk/drools-docs/drools-docs-expert/src/main/docbook/en-US/Chapter-User_Guide/Section-Building.xml	2009-04-17 09:36:57 UTC (rev 26098)
@@ -22,15 +22,15 @@
     <title>Building using Code</title>
 
     <para>The KnowledgeBuilder is responsible for taking source files, such as
-    a .drl file or an xls file, and turning them into a KnowledgePackage of
-    rule and process definitions which a KnowledgeBase can consume. It uses
-    the ResourceType enum to tell it the type of the resource it is being
+    a .drl file or an .xls file, and turning them into a KnowledgePackage of
+    rule and process definitions which a KnowledgeBase can consume. An object
+    of the class ResourceType indicates the type of resource it is being
     asked to build.</para>
 
     <para>The ResourceFactory provides capabilities to load Resources from a
-    number of sources; such as Reader, ClassPath, URL, File, ByteArray.
-    Binaries, such as xls decision tables, should not use a Reader based
-    Resource handler, which is only suitable for text based resource</para>
+    number of sources, such as Reader, ClassPath, URL, File, or ByteArray.
+    Binaries, such as .xls decision tables, should not use a Reader based
+    Resource handler, which is only suitable for text based resources.</para>
 
     <figure>
       <title>KnowledgeBuilder</title>
@@ -64,11 +64,11 @@
       <programlisting>KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();</programlisting>
     </example>
 
-    <para>A configuration can be created using the KnowledgeBuilderFactory
-    this allows the behaviour of the KnowledgeBuilder to modified. The most
+    <para>A configuration can be created using the KnowledgeBuilderFactory.
+    This allows the behavior of the KnowledgeBuilder to modified. The most
     common usage is to provide a custom ClassLoader so that the kbuilder can
     resolve classes that are not in the default classpath. The first parameter
-    is for Properties and is optional and may be left null in which case the
+    is for Properties and is optional, i.e., it may be left null, in which case the
     default options will be used. The options parameter can be used for things
     like changing the dialect or registering new accumulator functions.</para>
 
@@ -80,7 +80,7 @@
 </programlisting>
     </example>
 
-    <para>Resources, of any type, can be add iteratively. Below a DRL is
+    <para>Resources of any type can be added iteratively. Below, a DRL is
     added. Unlike Drools 4.0 PackageBuilder the KnowledgeBuilder can now
     handle multiple namespaces, so you can just keep adding resources
     regardless of namespace.</para>
@@ -94,8 +94,8 @@
     </example>
 
     <para>It is best practice to always check the hasErrors() method after an
-    addition, you should not add more resources or get the KnowledgePackages
-    if there are errors. KnowledgePackages() will return an empty list if
+    addition. You should not add more resources or retrieve the KnowledgePackages
+    if there are errors. getKnowledgePackages() returns an empty list if
     there are errors.</para>
 
     <example>
@@ -108,10 +108,10 @@
 </programlisting>
     </example>
 
-    <para>When all the resources has been added and there are no errors the
-    Collection of KnowledgePackages can be retrieved, it's a Collection as
-    there is one KnowledgePackage per package namespace; These
-    KnowledgePackages are serialisable and often used as a unit of
+    <para>When all the resources have been added and there are no errors the
+    collection of KnowledgePackages can be retrieved. It is a Collection because
+    there is one KnowledgePackage per package namespace. These
+    KnowledgePackages are serializable and often used as a unit of
     deployment.</para>
 
     <example>
@@ -121,10 +121,10 @@
 </programlisting>
     </example>
 
-    <para>The final examples puts it all together.</para>
+    <para>The final example puts it all together.</para>
 
     <example>
-      <title>Putting it together</title>
+      <title>Putting it all together</title>
 
       <programlisting>KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
 if( kbuilder.hasErrors() ) {
@@ -152,11 +152,10 @@
     <title>Building using Configuration and the ChangeSet XML</title>
 
     <para>Instead of adding the resources to create definitions
-    programmatically it is also possible to do it confiugrably via the
-    ChangeSet XML. There is currently no XSD schema for the change-set, but we
-    hope to add one soon. However the XML is very simple. The XML supports
-    three elements add, remove, modify - however currently only the add
-    element is supported - the later will be supprted as we eventually move to
+    programmatically it is also possible to do it by configuration, via the
+    ChangeSet XML. The simple XML file supports
+    three elements: add, remove, and modify. Currently only the add
+    element is supported, and the others will be implemented to
     support iterative changes. The following example loads a single DRL
     file.</para>
 
@@ -165,7 +164,7 @@
 
       <programlisting>&lt;change-set xmlns='http://drools.org/drools-5.0/change-set'
             xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'
-            xs:schemaLocation='http://drools.org/drools-5.0/change-set drools-change-set-5.0.xsd' &gt;
+            xs:schemaLocation='http://drools.org/drools-5.0/change-set.xsd' &gt;
    &lt;add&gt;
       &lt;resource source='file:/project/myrules.drl' type='DRL' /&gt;
    &lt;/add&gt;
@@ -174,40 +173,40 @@
     </example>
 
     <para>Notice the "file:" prefix, this signifies the protocol for the
-    resource. The ChangeSet supports all the protocolols provided by
-    java.net.URL, such as file" and "http", as well as an additional
+    resource. The ChangeSet supports all the protocols provided by
+    java.net.URL, such as "file" and "http", as well as an additional
     "classpath". Currently the type attribute must always be specified for a
-    resource, it is not inferred from the file name extension. While using the
-    ClassPath resource loader in java allows you to specify the ClassLoader to
-    be used to locate the resource, from the XML this is not possible. Instead
+    resource, as it is not inferred from the file name extension. Using the
+    ClassPath resource loader in Java allows you to specify the ClassLoader to
+    be used to locate the resource but this is not possible from XML. Instead,
     the ClassLoader will default to the one used by the KnowledgeBuilder
     unless the ChangeSet XML is itself loaded by the ClassPath resource, in
-    which case it'll use the ClassLoader specified for that resource.</para>
+    which case it will use the ClassLoader specified for that resource.</para>
 
-    <para>You currently still need to use the API to load that ChangeSet, but
-    we will add support for containers such as Spring in the future, so the
-    process of creating a KnowledgeBase becomes 100% XML configuration.
+    <para>Currently you still need to use the API to load that ChangeSet, but
+    we will add support for containers such as Spring in the future, so that the
+    process of creating a KnowledgeBase can be donw completely by XML configuration.
     Loading resources using the XML couldn't be simpler, as it's just another
     ResourceType.</para>
 
     <example>
       <title>Loading the ChangeSet XML</title>
 
-      <programlisting>kbuilder.add( ResourceFactory.newUrlResource( url ), ResourceType.ChangeSet );
+      <programlisting>kbuilder.add( ResourceFactory.newUrlResource( url ), ResourceType.CHANGE_SET );
 </programlisting>
     </example>
 
-    <para>Change sets can include any number of resources and even supports
+    <para>Changesets can include any number of resources, and they even support
     additional configuration information, which currently is only needed for
-    decision tables. Below the example is expanded to load the rules from a
-    http url location and an excel decision table from the classpath.</para>
+    decision tables. Below, the example is expanded to load rules from a
+    http URL location, and an Excel decision table from the classpath.</para>
 
     <example>
       <title>ChangeSet XML with resource configuration</title>
 
       <programlisting> &lt;change-set xmlns='http://drools.org/drools-5.0/change-set'
              xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'
-             xs:schemaLocation='http://drools.org/drools-5.0/change-set drools-change-set-5.0.xsd' &gt;
+             xs:schemaLocation='http://drools.org/drools-5.0/change-set.xsd' &gt;
   &lt;add&gt;
        &lt;resource source='http:org/domain/myrules.drl' type='DRL' /&gt;
        &lt;resource source='classpath:data/IntegrationExampleTest.xls' type="DTABLE"&gt;
@@ -221,11 +220,11 @@
     <para>The ChangeSet is especailly useful when working with KnowledgeAgent,
     as it allows for change notification and automatic rebuilding of the
     KnowledgeBase, which is covered in more detail in the section on the
-    KnowledgeAgent under Deploying.</para>
+    KnowledgeAgent, under Deploying.</para>
 
-    <para>Directories can also be specified, in such a situation all resources
-    in that folder are added, although currently it expected all resources in
-    that folder to be of the same type. If you use the KnowledgeAgent it will
+    <para>Directories can also be specified, to add all resources
+    in that folder. Currently it expected that all resources in
+    that folder are of the same type. If you use the KnowledgeAgent it will
     provide a continous scanning for added, modified or removed resources and
     rebuild the cached KnowledgeBase. The KnowledgeAgent provides more
     information on this.</para>
@@ -235,7 +234,7 @@
 
       <programlisting>&lt;change-set xmlns='http://drools.org/drools-5.0/change-set'
             xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'
-            xs:schemaLocation='http://drools.org/drools-5.0/change-set drools-change-set-5.0.xsd' &gt;
+            xs:schemaLocation='http://drools.org/drools-5.0/change-set.xsd' &gt;
    &lt;add&gt;
       &lt;resource source='file:/projects/myproject/myrules' type='DRL' /&gt;
    &lt;/add&gt;




More information about the jboss-svn-commits mailing list