[jboss-svn-commits] JBL Code SVN: r13347 - in labs/jbossrules/branches/mvel-tooling-2007-06-30: drools-compiler/src/main/java/org/drools/rule/builder/dialect/java and 1 other directory.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Jul 11 01:28:11 EDT 2007


Author: pombredanne
Date: 2007-07-11 01:28:11 -0400 (Wed, 11 Jul 2007)
New Revision: 13347

Modified:
   labs/jbossrules/branches/mvel-tooling-2007-06-30/documentation/manual/en/Chapter-BRMS/Section-UserGuide.xml
   labs/jbossrules/branches/mvel-tooling-2007-06-30/drools-compiler/src/main/java/org/drools/rule/builder/dialect/java/JavaFunctionBuilder.java
Log:
Ported r13346 from trunk to branch mvel-tooling-2007-06-30.

Modified: labs/jbossrules/branches/mvel-tooling-2007-06-30/documentation/manual/en/Chapter-BRMS/Section-UserGuide.xml
===================================================================
--- labs/jbossrules/branches/mvel-tooling-2007-06-30/documentation/manual/en/Chapter-BRMS/Section-UserGuide.xml	2007-07-11 04:30:19 UTC (rev 13346)
+++ labs/jbossrules/branches/mvel-tooling-2007-06-30/documentation/manual/en/Chapter-BRMS/Section-UserGuide.xml	2007-07-11 05:28:11 UTC (rev 13347)
@@ -133,7 +133,7 @@
 
         <listitem>
           <para>You will also have to choose one category. Cateogies provide a
-          way of viewing rules that is seperate to packages (and you can make
+          way of viewing rules that is separate to packages (and you can make
           rules appear in multiple packages) - think of it like
           tagging.</para>
         </listitem>
@@ -444,7 +444,7 @@
       </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
+      diagram above). Its change takes effect immediately, no separate save is
       needed.</para>
 
       <figure>
@@ -579,6 +579,15 @@
       have the option to create a snapshot for deployment. You can also view
       the "drl" that this package results in. WARNING: in cases of large
       numbers of rules, all these operations can take some time.</para>
+      
+      <section>
+      	<title>Importing drl packages</title>
+      	<para>It is also possible to create a package by importing an existing "drl" file.
+      	When you choose to create a new package, you can choose an option to upload a .drl file. The BRMS
+      	will then attempt to understand that drl, break create a package for you. The rules in it will be stored as individual assets (but still as drl text content).
+      	Note that to actually build the package, you will need to upload an appropriate model (as a jar) to validate against, as a separate step.
+      </section>
+      
     </section>
 
     <section>
@@ -626,7 +635,7 @@
 
       <para>The alternative and more technical view is to use the package
       explorer. This shows the rules (assets) closer to how they are actually
-      stored in the database, and also seperates rules into packages (name
+      stored in the database, and also separates rules into packages (name
       spaces) and their type (format, as rules can be in many different
       formats).</para>
 
@@ -725,7 +734,9 @@
 
       <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>
+      space separating them). Note also, instead of a discrete properties
+      file, you can construct a java.utils.Properties object, and pass it in
+      to the RuleBase methods.</para>
 
       <para>Referring to the above example, the "keys" in the properties
       are:</para>

Modified: labs/jbossrules/branches/mvel-tooling-2007-06-30/drools-compiler/src/main/java/org/drools/rule/builder/dialect/java/JavaFunctionBuilder.java
===================================================================
--- labs/jbossrules/branches/mvel-tooling-2007-06-30/drools-compiler/src/main/java/org/drools/rule/builder/dialect/java/JavaFunctionBuilder.java	2007-07-11 04:30:19 UTC (rev 13346)
+++ labs/jbossrules/branches/mvel-tooling-2007-06-30/drools-compiler/src/main/java/org/drools/rule/builder/dialect/java/JavaFunctionBuilder.java	2007-07-11 05:28:11 UTC (rev 13347)
@@ -5,6 +5,8 @@
 import java.io.InputStreamReader;
 import java.io.StringReader;
 import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 
@@ -48,8 +50,15 @@
         vars.put( "imports",
                   pkg.getImports() );
 
+        final List staticImports = new LinkedList();
+        for( Iterator it = pkg.getStaticImports().iterator(); it.hasNext(); ) {
+            final String staticImport = (String) it.next();
+            if( ! staticImport.startsWith( functionDescr.getClassName() ) ) {
+                staticImports.add( staticImport );
+            }
+        }
         vars.put( "staticImports",
-                  pkg.getStaticImports() );
+                  staticImports );
 
         vars.put( "className",
                   StringUtils.ucFirst( functionDescr.getName() ) );




More information about the jboss-svn-commits mailing list