[jboss-svn-commits] JBL Code SVN: r19007 - labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/brms/client/modeldriven/dt.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Sat Mar 15 00:17:02 EDT 2008


Author: mingjin
Date: 2008-03-15 00:17:02 -0400 (Sat, 15 Mar 2008)
New Revision: 19007

Modified:
   labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/brms/client/modeldriven/dt/ConditionCol.java
   labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/brms/client/modeldriven/dt/GuidedDecisionTable.java
Log:
recovered from merging.

Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/brms/client/modeldriven/dt/ConditionCol.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/brms/client/modeldriven/dt/ConditionCol.java	2008-03-15 03:10:59 UTC (rev 19006)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/brms/client/modeldriven/dt/ConditionCol.java	2008-03-15 04:17:02 UTC (rev 19007)
@@ -2,19 +2,50 @@
 
 import org.drools.brms.client.modeldriven.brl.PortableObject;
 
-import java.io.ObjectOutput;
-import java.io.IOException;
-import java.io.ObjectInput;
-
+/**
+ * This is the config for a condition column. Typically many of them have their constraints added.
+ *
+ * @author Michael Neale
+ *
+ */
 public class ConditionCol implements PortableObject {
 
-    public String header;
+	/**
+	 * What is displayed at the top
+	 */
+	public String header;
 
-    public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
-        header  = (String)in.readObject();
-    }
+	/**
+	 * The type of the fact - class - eg Driver, Person, Cheese etc.
+	 */
+	public String factType;
 
-    public void writeExternal(ObjectOutput out) throws IOException {
-        out.writeObject(header);
-    }
+	/**
+	 * The name that this gets referenced as. Multiple columns with the same name mean their constraints will be combined.
+	 */
+	public String boundName;
+
+	/**
+	 * The type of the value that is in the cell, eg if it is a formula, or literal value etc.
+	 * The valid types are from ISingleFieldConstraint:
+	 *   TYPE_LITERAL
+	 *   TYPE_RET_VALUE
+	 *   TYPE_PREDICATE (in this case, the field and operator are ignored).
+	 */
+	public int constraintValueType;
+
+
+	/**
+	 * The field of the fact that this pertains to (if its a predicate, ignore it).
+	 */
+	public String factField;
+
+
+	/**
+	 * The operator to use to compare the field with the value (unless its a predicate, in which case this is ignored).
+	 */
+	public String operator;
+
+
+
 }

Modified: labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/brms/client/modeldriven/dt/GuidedDecisionTable.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/brms/client/modeldriven/dt/GuidedDecisionTable.java	2008-03-15 03:10:59 UTC (rev 19006)
+++ labs/jbossrules/trunk/drools-compiler/src/main/java/org/drools/brms/client/modeldriven/dt/GuidedDecisionTable.java	2008-03-15 04:17:02 UTC (rev 19007)
@@ -1,35 +1,70 @@
 package org.drools.brms.client.modeldriven.dt;
 
-import java.util.ArrayList;
-import java.util.List;
+import org.drools.brms.client.modeldriven.brl.PortableObject;
+
 import java.io.IOException;
 import java.io.ObjectInput;
 import java.io.ObjectOutput;
+import java.util.ArrayList;
+import java.util.List;
 
 import org.drools.brms.client.modeldriven.brl.PortableObject;
 
+/**
+ * This is a decision table model for a guided editor. It is not template or XLS based.
+ * (template could be done relatively easily by taking a template, as a String, and then String[][] data and driving the SheetListener
+ * interface in the decision tables module).
+ *
+ * This works by taking the column definitions, and combining them with the table of data to produce rule models.
+ *
+ * @author Michael Neale
+ */
 public class GuidedDecisionTable implements PortableObject {
 
+	/**
+	 * The name - obviously.
+	 */
+	public String tableName;
+
+	/**
+	 * @gwt.typeArgs <org.drools.brms.client.modeldriven.dt.AttributeCol>
+	 */
+	public List attributeCols = new ArrayList();
+
+	/**
+	 * @gwt.typeArgs <org.drools.brms.client.modeldriven.dt.ConditionCol>
+	 */
 	public List conditionCols = new ArrayList();
+
+	/**
+	 * @gwt.typeArgs <org.drools.brms.client.modeldriven.dt.ActionCol>
+	 */
 	public List actionCols = new ArrayList();
 
 	/**
 	 * First column is always row number.
 	 * Second column is description.
-	 * Subsequent ones follow the above column definitions.
+	 * Subsequent ones follow the above column definitions:
+	 * attributeCols, then conditionCols, then actionCols, in that order, left to right.
 	 */
 	public String[][] data;
 
+	//TODO: add in precondition(s)
 
+
 	public GuidedDecisionTable() {}
 
     public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
+        tableName       = (String)in.readObject();
+        attributeCols   = (List)in.readObject();
         conditionCols   = (List)in.readObject();
-        actionCols   = (List)in.readObject();
+        actionCols      = (List)in.readObject();
         data   = (String[][])in.readObject();
     }
 
     public void writeExternal(ObjectOutput out) throws IOException {
+        out.writeObject(tableName);
+        out.writeObject(attributeCols);
         out.writeObject(conditionCols);
         out.writeObject(actionCols);
         out.writeObject(data);




More information about the jboss-svn-commits mailing list